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
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.