Array wave print coulumn wise my custom ans is right but test cases are all wrong

#include
using namespace std;
int main() {

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

this is my code

hey @Anoushka_1805, there lots of mistakes in your code like:

  1. You interchange m and n
  2. You interchange i and j
  3. output should be , separated you made it space separated.

I have made changes to your code only you can check them here https://ide.codingblocks.com/s/97446