/* * Author : Amit Dutta * Date : 08 Feb 2026 * Repo : https://github.com/notamitgamer/bsc * License : MIT License (See the LICENSE file for details) */ /* Write a program to find if a square matrix is symmetric. */ /* Let Us C, Chap- 14 (Multidimensional Arrays), Qn No.: C(e) */ /* This file is auto-generated by a bot. */ /* This code is not compiled; it is for reference only. */ #include #include int main() { int mat[10][10], n, i, j; int is_symmetric = 1; printf("Enter the size of the square matrix (max 10): "); scanf("%d", &n); printf("Enter elements of the %dx%d matrix:\n", n, n); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { scanf("%d", &mat[i][j]); } } // Check for symmetry: mat[i][j] must equal mat[j][i] for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (mat[i][j] != mat[j][i]) { is_symmetric = 0; break; } } if (is_symmetric == 0) break; } if (is_symmetric) printf("\nThe matrix is Symmetric.\n"); else printf("\nThe matrix is NOT Symmetric.\n"); return 0; }