Error in output:image rotattion

#include
using namespace std;
void transpose(int a[][1000],int n)
{
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
swap(a[i][j],a[j][i]);
}
}
}
void reverse_col(int b[][1000],int n)
{
int k;
for(int i=0;i<n;i++)
{
k=n-1;
for(int j=0;j<k;j++)
{
swap(b[i][j],b[k][j]);
k–;
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cout<<b[i][j];
}
}
}
int main()
{ int n;
cin>>n;
int arr[1000][1000];
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
cin>>arr[i][j];
}
transpose(arr,n);
reverse_col(arr,n);
return 0;
}

why is test case not wokring?

@Vibhuti0206 save your code through coding blocks ide

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.