It shows wrong in every test case

#include
using namespace std;
int main() {

int a[100][100];
int m,n,oddcol=2,evencol=1;
cin>>m>>n;
for(int i = 1; i <= m; i++){
  for(int j = 1; j <=n; j++){
    cin>>a[i][j];

  }
  cout<<endl;
}
while(evencol<=n){
  for(int i = 1; i <= m; i++){
    cout<<a[i][evencol]<<","<<" ";
  }
  evencol = evencol+2;
  if(oddcol<=n){
    for(int i = n; i > 0; i--){
      cout<<a[i][oddcol]<<","" ";
    }
  }
  oddcol = oddcol+2;
}

// cout<<“END”;
return 0;
}

Hey Shivam, mention the problem’s exact name here and also share your code’s ide link.

ARRAYS-WAVE PRINT COLUMN WISE
https://online.codingblocks.com/player/15206/content/4825?s=3189

Hey Shivam, this link is not accessible, copy your code on online ide, save it and share that link here.

Hey Shivam, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required. And please mark your doubts as resolved in your course’s “Ask Doubt” section, when your doubt is resolved.