How to take mirror image of 2d array

Got till transpose of a 2d array but having trouble figuring out how to find mirror image.


this is my code

Hi @Vivek-Pandey-2129725577345937
You can rotate a matrix without using extra space by first making transpose of it and then reversing it. This can be done as following :

// After transpose we swap elements of column
// one by one for finding left rotation of matrix
// by 90 degree
void reverse(int arr[r][c])
{
for (int i = 0; i < c; i++)
for (int j = 0, k = c - 1; j < k; j++, k–)
swap(arr[j][i], arr[k][i]);
}

// Function for do transpose of matrix
void transpose(int arr[r][c])
{
for (int i = 0; i < r; i++)
for (int j = i; j < c; j++)
swap(arr[i][j], arr[j][i]);
}