What value is returned by the method named result?
int result(int [ , ] anArray)
{
int j = 0,
i = 0;
for (int r = 0; r < anArray.GetLength(0); r++)
for (int c = 0; c < anArray.GetLength(1); c++)
if (anArray[r, c] < anArray[i, j])
{
i = r;
j = c;
}
return i;
}
a. the row index of the largest element of array anArray
b. the value of the largest element of array anArray
c. the row index of the smallest element of array anArray
d. the column index of the smallest element of array anArray
e. the index of the last element greater than its predecessor
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'.