erm im trying to create a function to test if an array/matrix is symmetrical
that is for example a[i,j] = a[j,i]
i think i got the symmetrical test function correct....just that i dont know where to put that if-else statement. it just doesnt seem to fit anywhere in my codes.
#include <iostream>
using namespace std;
const int MAXROW = 10;
const int MAXCOL = 10;
int main()
{
srand(time(NULL));
int a [MAXROW][MAXCOL];
for (int row = 0; row < MAXROW; row++)
{
for (int col = 0; col < MAXCOL; col++)
{
a[row][col] = rand () % 10;
cout << a[row][col] << "\t";
}
cout << endl;
if (a[row][col] == a[col][row])
cout << "Symmetric" << endl;
else
cout << "Not symmetric" << endl;
}
return 0;
}