Regarding "Arrays-Wave print ColumnWise"

can you please help me out in the code i have written.
#include
using namespace std;
int main() {
int m,n,i,j,k,l;
cin>>m>>n;
int a[m][n];
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
cin>>a[m][n];
}
}
for(k=0;k<n;k++)
{ if(k%2!=0){
for(l=0;l<m;l++)
{
cout<<a[l][k]<<",";
}}
else
for(l=m-1;l>=0;l–){
cout<<a[l][k]<<",";
}

}
return 0;

}

@CHANDU_0556 hey mohan could you please share me code through ide link

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.