Write a program in c to find the largest no out of a matrix of order mn?

/* using ellipses (...) to indicate tabs for clarity */

double largest (double *array, int M, int N) {

... int i, j;

... double *element;

... double answer = array[0][0];

... for (i=0; i<M; i++) {

... ... for (j=0; j<N; j++) {

... ... ... element = array + i*M + j;

... ... ... if (*element > answer) answer = *element;

... ... }

... }

... return answer;

}