Getting no output

I did run my code in DEVC++ successfully but can’t run it on CB IDE

Hey Meghna, share your code’s ide link and also mention the problem’s exact name here. So, that we can help you in debugging the code.

https://online.codingblocks.com/player/15624/content/4825?s=3189
Que: Array-Wave Print Column Wise
#include
using namespace std;
#define M 10
#define N 10

void waveprint(int m,int n,int ar[M][N])
{
int i;
int wave=1;
int j=0;
while(j<n)
{
if(wave==1)
{
for(i=0;i<m;i++)
cout<<ar[i][j]<<",";
wave=0;
j++;
}
else
{
for(i=m-1;i>=0;i–)
cout<<ar[i][j]<<",";
wave=1;
j++;
}
}
cout<<“END”<<endl;
}

int main() {
int m,n;
cin>>m;
cin>>n;
int ar[M][N];
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
cin>>ar[i][j];
}
}
waveprint(m,n,ar);
return 0;
}

Hey Meghna, your code is working fine there is just a small mistake, your code’s output should exactly match the given output format of the problem so put a space after commas like this ", ". And its printing the output on CB ide also,