Problem: Write a C program to check whether the given matrix is an identity matrix or not.

In linear algebra, the identity matrix (sometimes ambiguously called a unit matrix) of size n is the n × n square matrix with ones on the main diagonal and zeros elsewhere

Identity Matrix

Here, is the c program to check an identity matrix.

Output

C Program to check Identity Matrix

Output of program in C

In the program we have used a 2D array to represent matrix and for loops to loop through the matrix elements.

If you have any doubts regarding the program to check the identity matrix in c then please comment below.

Leave a Reply