What's wrong with my code?(ARRAY-WISE print Column Wise)

it’s showing wrong output after submission.
my code:
#include
using namespace std;
int main() {
int arr[10][10],row,col;
cin>>row>>col;
for(int i=0;i<row;i++){
for(int j=0;j<col;j++){
cin>>arr[i][j];
}
}
for(int i=0;i<col;i++){
if(i%2==0){
for(int j=0;j<row;j++){
cout<<arr[j][i]<<",";
}
}
else{
for(int j=row-1;j>=0;j–){
cout<<arr[j][i]<<",";
}
}

}
cout<<"END";
/*for(int i=0;i<row;i++){
	for(int j=0;j<col;j++){
		cout<<arr[i][j]<<" ";
	}
	cout<<endl;
}*/
return 0;

}

Hello @aceash98,
You have marked your code as resolved.

Have you corrected it yourself, or have you accidentally marked it as resolved?
If it was a mistake, then let me know.
I am here to resolve your doubt.

1 Like

I have corrected it myself