Whats Wrong in this code?

#include
using namespace std;

int main(){

int n, m;
cin >> n;
cin >> m;
int a[n][m];


for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
        cin >> a[i][j];
    }
}

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

return 0;

}

ok let me check can you send the question link?

How to send question link?

@simmy_gupta0404 you forgot to display END in last

i hope your doubt is cleared if yes dont forget to mark it as resolved in my doubts section :smiley: