Answer to Question #201449 in C++ for shuvo

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;
}
1
Expert's answer
2021-06-02T07:48:46-0400

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog