What is wrong in this compilation is successful and output is correct but when i submit every testcase seems wrong

#include
using namespace std;

int main(){
int r,c;
cin>>r;
cin>>c;
int a[r][c];
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
cin>>a[i][j];
}
}
for(int j=0;j<c;j++){
if(j%2==0){
for(int i=0;i<r;i++){
cout<<a[i][j]<<" ā€œ;
}
}
else{
for(int i=r-1;i>=0;i–){
cout<<a[i][j]<<ā€ ";
}
}
}
cout<<endl;
return 0;
}

Save your code on ide.codingblocks.com and then share its link.

after saaving i cant share it is showing no link when i click on share

https://ide.codingblocks.com/s/251709 this is the code please tell the error

Consider this test case:
2 6
1 2 3 4 5 6
7 8 9 10 11 12

Expected Output:
1, 7, 8, 9, 10, 11, 12, 6, 5, 4, 3, 2, END

Your output:
1 7 8 2 3 9 10 4 5 11 12 6

You can https://www.youtube.com/watch?v=siKFOI8PNKM watch this for the approach.