subject

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;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
question
Computers and Technology, 23.06.2019 13:50
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
question
Computers and Technology, 24.06.2019 19:30
Can someone who is skilled at coding create me a java chess game. don't copy from online source codes. make it original ! : d
Answers: 1
You know the right answer?
During testing, a student receives the incorrect answer back from a function that was supposed to be...
Questions
question
Mathematics, 07.03.2020 01:47
Questions on the website: 13722360