Question #201449

Read the following function and explain if this function finds the biggest value stored in
the array..
int biggest(int a[], int current_length)
{
int biggest = 0;
for (int i = 0; i < current_length; i++)
{
if (a[i] > biggest){
biggest = a[i];
}
}
return biggest;
}

Expert's answer

The function will only return the biggest value stored in the array if the array is filled with positive numbers. For an array of negative numbers, it will return 0.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS