23.3k views
0 votes
If you pass the array ar to the method m() like this, m(ar); the element ar[0] :

A. will be changed by the method m()
B. cannot be changed by the method m()
C. may be changed by the method m(), but not necessarily
D. None of these

User Bmurauer
by
5.2k points

1 Answer

4 votes

Answer: (B)

Step-by-step explanation:

Any changes on array made inside the function m() will only affect the ar[] present inside the function that means its scope is only within the function. The original array ar[] outside the fuction's scope won't change.

User Nils Petersohn
by
4.4k points