double findMax(double a[ROWS][COLS])? Implement a function called findMax that d
ID: 3552058 • Letter: D
Question
double findMax(double a[ROWS][COLS])?Implement a function called findMax that determines the maximum value in a 2-dimensional array. A declaration of the function is shown above. The variables ROWS and COLS are constants defined elsewhere in the program? you don double findMax(double a[ROWS][COLS])?
Implement a function called findMax that determines the maximum value in a 2-dimensional array. A declaration of the function is shown above. The variables ROWS and COLS are constants defined elsewhere in the program? you don Implement a function called findMax that determines the maximum value in a 2-dimensional array. A declaration of the function is shown above. The variables ROWS and COLS are constants defined elsewhere in the program? you don
Explanation / Answer
double findMax(double a[ROWS][COLS])
{
double max=a[0][0];
for(int i=0; i<ROWS ;i++)
{
for(int j=0; j<COLS; j++)
{
if(a[i][j] > max)
max=a[i][j];
}
}
return max;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.