Mistake in my code?

not passing all the testcases
question-wave print column wise
#include
using namespace std;
int main() {
int n,m;
cin>>n>>m;
int a[n][m];
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
cin>>a[i][j];
}
for(int i=0;i<n;i++)
{ if(i%2==0)
{
for(int j=0;j<m;j++)
cout<<a[j][i]<<", β€œ;
}
else
{
for(int j=m-1;j>=0;j–)
cout<<a[j][i]<<”, ";
}
}
cout<<β€œEND”;
return 0;
}

Hi, refer this https://ide.codingblocks.com/s/630703

Hi, i hope its clear now??

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.