Ask Question
20 October, 08:10

During testing, a student receives the incorrect answer back from a function that was supposed to be designed to return the largest value found in an array of double values provided as a parameter. Read the function definition used for this purpose, and identify the error:

int findMax (double arr [ ], int s)

{

int i;

int indexOfMax = 0;

double max = arr[0];

for (i=1; i < s; i++)

{

if (arr[ i ] > arr [indexOfMax])

{

indexOfMax = i;

max = arr[indexOfMax];

}

}

return indexOfMax;

}

+3
Answers (1)
  1. 20 October, 11:44
    0
    dude what r u doin
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “During testing, a student receives the incorrect answer back from a function that was supposed to be designed to return the largest value ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers