sir i dont uncerstanding why my cases are having worng answer in cheked it manually on dev by pasting the same code multiple time and running on different output
#include
using namespace std;
int main() {
int i,j;
int M,N;
cin>>M>>N;
if(11>M>0 && 11>N>0)
{
int arr[M][N];
for(i=0;i<M;i++)
{
for(j=0;j<N;j++)
{
cin>>arr[i][j];
}
}
for(i=0;i<M;i++)
{
if(i==0)
{
for(j=0;j<N;j++)
{
cout<<arr[j][i]<<", ";
}
}
if(i==1)
{
for(j=N-1;j>=0;j--)
{
cout<<arr[j][i]<<", ";
}
}
if(i>=2 && i%2==0)
{
for(j=0;j<N;j++)
{
cout<<arr[j][i]<<", ";
}
}
if(i>=2 && i%2!=0)
{
for(j=N-1;j>=0;j--)
{
cout<<arr[j][i]<<", ";
}
}
}
cout<<"END";
}
return 0;
}