Problem in execution of code

heyy, my code is showing no output can you tell what is the prblm withe the code

#include
using namespace std;
int main() {

int m,n,i,j;
cin>>m>>n;
int arr[10][10];

for( i=0;i<m;i++)
{
    for(int j=0;j<n;j++)
    {
        cin>>arr[i][j];
    }
}

for(j=0;j<n;i++)
{
    if(j%2!=0)
    {
        for(i=m-1;i>=0;i--)
        {
            cout<<arr[i][j]<<",";
        }
    }
    else
    {
        for(i=0;i<m;i++)
        {
            cout<<arr[i][j]<<",";
        }
    }
}
cout<<"END";
return 0;

}

Hi @Aparna
See in the for(j=0;j<n;i++) instead of incrementing j you are incrementing i that is why your code is going into infinite loop. Also after “,” you have to print a space like this ", ".

Here is your corrected code :

yeah i already found the prblm and submitted the code.
Thanks :slight_smile: