The code is correct but not passing any test cases

#include
using namespace std;
int main()
{
int val =1;
int arr[100][100];
int m ,n;
cin>>m>>n;
for(int i =0;i<m;i++)
{
for(int j =0;j<n; j++)
{
arr[i][j]= val;
val = val+1;
cout<<arr[i][j]<<" ";

	}cout<<endl;
}
for(int col =0 ;col<n;col++)
{
	if(col% 2==0)
	{
		for(int row =0 ;row<m ;row++)
		{
			cout<<arr[row][col]<<",";
		}
	}
	else
	{
		
		for (int row =m-1 ;row>=0 ;row--)
		{
			cout<<arr[row][col]<< ",";
			
		}
	

	}
	
}cout<<"END"<<endl;
return 0;

}

take input from the user instead of filling the array with sequential values

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.