Ask Question
28 May, 09:43

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. 28 May, 11:45
    0
    dude what r u doin
Know the Answer?
Not Sure About the Answer?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers