Wave print array

hey i have tried this code in my system whats wrong with this code

#include
using namespace std;
int main()
{
int m,n;
cin>>m>>n;
int a[m][n];
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
cin>>a[i][j];

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

}
cout<<“END”;

return 0;

}

you made several small mistakes in your code, I have corrected them and added comments with them please check the new code

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.