Question: What value is returned by the method named result? int result(int[ ] anArray, int num) { int i, r; for (r = 0, i =

What value is returned by the method named result?

int result(int[ ] anArray, int num)

{

int i, r;

for (r = 0, i = 1; i < num; ++i)

if (anArray[i] > anArray [r] )

r = i;

return (r);

}

a. the index of the largest of the first num elements of array anArray

b. the value of the largest of the first num elements of array anArray

c. the index of the smallest of the first num elements of array anArray

d. the value of the smallest of the first num elements of array anArray

e. the index of the last element greater than its predecessor within the first num elements of array anArray

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Systems Analysis Design Questions!