for(int i=0;i<N;i++)
{
for(int j=0;j<N;j++)
{
int t=arr[i][j];
arr[i][j]=arr[j][i];
arr[j][i]=t;
}
}
What is problem in this part
this will simply give us back the same matrix as the input
for(int i=0;i<N;i++)
{
for(int j=0;j<N;j++)
{
int t=arr[i][j];
arr[i][j]=arr[j][i];
arr[j][i]=t;
}
}
this will simply give us back the same matrix as the input