Finding the maximum row of a 4x4 matrix
The first thing I'd do if I were refactoring this code is get rid of recursion.

You should be able to do it with a variable to keep track of "best row number so far", and a simple "for each row" loop. Inside the loop would be code that compares the current row with the best row so far (and does "best row so far = current row" if the current row is better).

Example:

int maxRow(int a[4][4]) {
    int i,j;
    int bestRow = 0;

    for(i = 1; i &lt; 4; i++) {
        for(j = 0; j &lt; 4; j++) {
            if(a[i][j] !=  a[bestRow][j]) {
                if(a[i][j] &gt; a[bestRow][j]) {
                    bestRow = i;
                }
                break;
            }
        }
    }
    return bestRow;
}