/* Matrix Diagonal - Program to check whether a given matrix is diagonal matrix */ /* A diagonal matrix is that square matrix whose diagonal elements from upper left to lower right are non-zero and all other elements are zero. For example, 2 0 0 0 4 0 0 0 6 */ #include #include void main() { int x[10][10], nr, nc, r, c, flag ; clrscr() ; printf("Enter the number of rows and columns: ") ; scanf("%d %d", &nr, &nc) ; if(nr==nc) /* checking for square matrix */ { printf("Enter elements of the matrix: \n") ; for(r=0 ; r