I am writing code to check if matrix is symmetric or not, I have already made transpose() method. Now I want to use that transpose method in my CheckSymmetry() method body to avoid writing code for transpose again. Please help in C++:
void CheckSymmetric(float a[3][3]) {int isSymmetric = 0;// I want to use transpose method herefor (int i = 0; i < 3;="" i++)="">for (int j = 0; j < 3;="" j++)="">if (a[i][j] != transpose())isSymmetric = 1;}}if (isSymmetric)cout < "the="" matrix="" is="" symmetric.\n="">elsecout < "the="" matrix="" is="" not="" symmetric.\n="">}
void Transpose(float a[3][3]) {float transpose[3][3];for (int i = 0; i < 3;="">for (int j = 0; j < 3;="" ++j)="">transpose[j][i] = a[i][j];}// Printing the transposecout < "\ntranspose="" of="" matrix:="" "=""><>display(transpose);}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here