Try something like this
suppose matrice a of size (n x m)
for(int i=0; i<n;i++)
{
for(int j=m-1; j>=0;j--)
{
printf("%d ", a[j][i]); cout<<a[j][i]; }
printf("\n"); or }
if you want to save it to other matrix:
Take another matrix, say b of size (n x m)
int x = 0;
for(int i=0; i<n;i++)
{
for(int j=m-1; j>=0;j--)
{
printf("%d ", a[j][i]); cout<<a[j][i]; b[i][x++] = a[j][i];
}
x = 0;
printf("\n"); or }
if you matrix is
1 2
3 4
it will return
3 1
4 2