Error in output by code editor

#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 j=0;j<N;j++){
		if(j%2==0){
			for(int i=0;i<M;i++){
				cout<<a[i][j]<<",";
			}
		}
		else{
			for(int i=M-1;i>=0;i--){
				cout<<a[i][j]<<",";
			}
		}
		}
cout<<"END";
return 0;

}

This is my code and is compiling and giving correct output in codingblocks ide but is giving the following error in code editor in challenges section:
/bin/run.sh: line 4: 19 Bus error (core dumped) ./exe codingblocks

Please resolve this problem

@avichalguptajwr here corrected you have to print space after " , "


dont forget to mark the doubt resolved :smiley:

I have even tried by pasting the code given in the solution section but still the following error is being shown on pressing compile and test:

/bin/run.sh: line 4: 19 Bus error (core dumped) ./exe

/bin/run.sh: line 4: 18 Bus error (core dumped) ./exe

@avichalguptajwr try to run on online compiler coz it runs fine in mine submit it directly