Code not running. Bus error. I am providing my code for wave print

#include<bits/stdc++.h>
using namespace std;

int main()
{
int m,n;
cin>>m>>n;
int a[m][n];
for(int row=0;row<m;row++)
{
for(int col=0;col<n;col++)
{
cin>>a[row][col];
}
}
for(int col=0;col<n;col++)
{
if(col%2==0){
for(int row=0;row<m;row++)
cout<<a[row][col]<<",";
}
else if(col%2==1)
{
for(int row=m-1;row>=0;row–)
cout<<a[row][col]<<",";
}
}
cout<<“END”;
return 0;
}

hello @atishay21
your code is correct.
make sure u r giving input before compiling.

if still it fails then pls save ur code here -> https://ide.codingblocks.com/
and share the link with me

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.