- 1
To find if a matrix is identity or not.
A SQUARE MATRIX is an IDENTITY MATRIX when the elements of only one DIAGONAL (generally LâR diagonal, whose index numbers are same) are 1 and the rest is 0. My input is 1 0 0 0 1 0 0 0 1. The output is "Not an identity matrix". https://code.sololearn.com/cizW6280x13K/?ref=app
3 Answers
0
Thank you
0
And why is that? What's the problem with freeing up the memory after reading the array?