Reversing problem

//problem in calling the function

#include
using namespace std;

void rotate(int n, int arr[][100]){

for (int row = 0; row < n; ++row)
{
	for (int col = 0; col < n; ++col)
	{
		int x=0;
		int y=n-1;
		while(x<y){
			swap(arr[row][x],arr[row][y]);
			x++;
			y--;
		}
	}
}

}
int main()
{
int n;
cin>>n;
int row,col;
int arr[n][n];

int val=1;
for (int i = 0; i < n; ++i)
{
	for (int j = 0; j < n; ++j)
	{
		arr[i][j]=val;
		val++;
	}
}

rotate(n,arr);
return 0;

}

hi @srivastavaayush1611_3fd51b257da0b834 u dont need to for loops see the vid again

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.