# include int main ( ) { int i; int j; int m; int n; printf ( "Enter M and N, the matrix dimensions:" ); scanf ( "%i%i", &m, &n ); // // Only declare the matrix at run time, after you have gotten the size. // int a[m][n]; // // To make sure this works, let's fill up the matrix with numbers. // for ( i = 0; i < m; i++ ) { for ( j = 0; j < n; j++ ) { a[i][j] = 10 * i + j; } } // // And now we'll print out our matrix. // for ( i = 0; i < m; i++ ) { for ( j = 0; j < n; j++ ) { printf ( "%4i", a[i][j] ); } printf ( "\n" ); } return 0; }