RUn time ERROR my o/p is coming correct thrn also

plz correect the code

@abhay_091

while(f<n)
{
if(f%2==0)
{
for(int i=0;i<m;i++)
{
System.out.print(a[i][f]+", ā€œ);
}
}
else
{
for(int i=m-1;i>=0;i–)
{
System.out.print(a[i][f]+ā€, ");
}
}
f+=1;
}

you move the i loops for m not n