In: Computer Science
Given the existence of two-dimensional array double A[M][N], where M and N are #defined as the number of rows and columns, respectively, define a function named sqabsmax that accepts array A as an argument (i.e. input parameter) and returns the square of the maximum absolute value element in A. Use the const qualifier if appropriate. Only show the function definition. Do not write an entire program with a main function. Just write the definition for function sqabsmax.
in C
const double sqabsmax(double A[][N])
{
double maximum = fabs(A[0][0]);
int c=0,d=0;
for (c = 0; c < M; c++)
for (d = 0; d < N; d++)
if (fabs(A[c][d]) > maximum)
maximum = fabs(A[c][d]);
return maximum*maximum; //square of the maximum absolute value
}