In my dev c++ compiler, it shows the same output. why it shows wrong here.
here is my code.
int main()
{
int a,b, arr[100][100];
cin>>a>>b;
for(int i=0; i<a; i++){
for(int j=0; j<b; j++){
cin>>arr[i][j];
}
}
for(int j=0; j<a; j++){
if(j%2==0)
{
for(int i=0; i<b; i++)
cout<<arr[i][j]<<" ";
}
else
{
for(int i=b-1; i>=0; i--)
cout<<arr[i][j]<<" ";
}
}
cout<<"END";
}