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 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
question
Computers and Technology, 25.06.2019 00:10
Select the correct answer sarah wants to use a device to input signatures on electronic documents. which input device will be most suitable for her? a digital pen b. laser pen c keyboard d. touchscreen reset next
Answers: 2
question
Computers and Technology, 25.06.2019 01:30
The physical parts or components of a computer system is called .
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
History, 01.12.2020 21:30
question
Mathematics, 01.12.2020 21:30
question
English, 01.12.2020 21:30
question
Mathematics, 01.12.2020 21:30
question
Mathematics, 01.12.2020 21:30
question
Mathematics, 01.12.2020 21:30
question
Computers and Technology, 01.12.2020 21:30
question
Mathematics, 01.12.2020 21:30
Questions on the website: 13722360