Array wave print column wise

My code gives the expected output as shown, but it still fails test cases. Please check the code and suggest changes:

for(int i=0;i<m;i++){
if(i%2==0){
for(int j=0;j<n;j++)
cout<<a[i][j]<<", β€œ;
}
else{
for(int j=n-1;j>=0;j–)
cout<<a[i][j]<<”, ";
}
}
cout<<β€œEND”;

Here I corrected your code https://ide.codingblocks.com/s/308659, your code had many small errors, please see them.