Arrays-wave print column

output is coming right but compiler shows wong why can you help

@vivan.singh hey vivek can you please share your code.

#include using namespace std; int main() { // your code goes here int n,m; cin>>n>>m; int a[10][10]; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { cin>>a[i][j]; } } for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(i%2==0) { cout<<a[j][i]<<","; } else { cout<<a[n-j-1][i]<<","; } } } cout<<β€œEND” return 0; }