Getting same output in console as given in test case but on submitting no test case is correct

#include
using namespace std;
int main() {
int m, n;
cin>> m >> n;
int arr[m][n];

for(int i=0; i<m; i++){
	for(int j=0; j<n; j++){
		cin >> arr[i][j];
	}
}

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

}

@manas_gautam, I rem this question is little bit wrong in m and n value so just change n to m and m to n everywhere and try submitting once else I’ll check

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.