![]() |
VOOZH | about |
The below program checks if two square matrices of size 4*4 are identical or not. For any two matrices to be equal, a number of rows and columns in both the matrix should be equal and the corresponding elements should also be equal.
Implementation:
Matrices are identical
The program can be extended for rectangular matrices. The following post can be useful for extending this program.
How to pass a 2D array as a parameter in C?
Time complexity: O(n2).
Auxiliary space: O(1).