Arrays-Wave print Column Wise

Hello Buddy,
once look in to my code and Please sort out my issue/error Please

in line 17 do
if (i%2 == 1) {

also your code gives run time error for cases where m!=n .try to debug for that

i am not getting where, please help me also pleas

that debug thing please

refer to this