Testcases are wrong

what is the problem in my code?please explain
#include
using namespace std;
main()
{
int a[50][50];
int i,j,r,c;
cin>>r>>c;
for(i=0;i<r;i++)
{ for(j=0;j<c;j++)
{
cin>>a[i][j];
}
}
for(j=0;j<c;j++)
{
if(j%2==0)
{
for(i=0;i<r;i++)
{
cout<<a[i][j]<<" “;
}
}
if(j%2!=0 or j==1)
{
for(i=r-1;i>=0;i–)
{
cout<<a[i][j];
cout<<” ";
}
}
}

}

Hi @tharun
Output has to be printed in a particular format, that is after every number you have to print a comma and at the end you have to print END, this is what is missing in your code.

Here is your corrected code :

Mark your doubt as resolved if it is clear.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.