I am able to run this on my desktop but not on cb compiler

#include

using namespace std;

int main()
{

int m,n;

cin>>m>>n;
int a[m][n]={0};

for(int i=0;i<=n-1;i++){
    for(int j=0;j<=m-1;j++){
        cin>>a[i][j];
    }
}
for(int j=0;j<=m-1;j++){
    if(j%2==0){
        for(int i=0;i<=n-1;i++){
            cout<<a[i][j]<<" ";
        }
    }
    else{
        for(int i=n-1;i>=0;i--){
            cout<<a[i][j]<<" ";
        }
    }
}
return 0;

}

hello @rajharsh865 could you please share your code by saving it one ide.codingblocks.com.

This is the code

@rajharsh865 this is the correct code and now it is giving the correct output .


please mark this doubt as resolved if you feel that your doubt is cleared .
Happy Learning !!

I tried this but it showing that time limit is exceeded…

@rajharsh865 please do hard refresh and then try because it is printing the correct result when i am running it .
try to run the code which i shared with you it is working fine .
Happy Learning !!