Arrays wave print column wiseruntime error


why does it show runtime error??
what is wrong

Hey
There is some issue in logic, see the below bold parts:
if(p==0)
{
j=0;
while(j<nRow)
{
cout<<v[j][i]<<", “;
j++;
}
p=1;
}
else //if u dont put this then your control will go to next if also
if(p==1)
{
j=nRow-1;
while(j>=0)
{
cout<<v[j][i]<<”, ";
j–; //this is obvious, try not repeating such small mistakes :wink:
}
p=0;
}
Dont forget to mark this doubt resolved if it has been cleared!!

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.