void diag(int n, int a[n][n]) { int i, j; for (i = 0; i < n; ++i) for (j = 0; j < n; ++j) a[i][j] = i == j ? 1 : 0; } End of Listing