Arrays-Wave print Column Wise(1)

I have tried a few solutions but none seems to work. Can someone please help me out with my code or tell the corrections in my code.
https://ide.codingblocks.com/s/51481

Hey Mayank, can you please mention the exact problem’s name which you are talking about and also share the link of your code here. (copy your code on online ide, save it and then share that link here)

Hey Mayank, your code will not when no. of rows and no. of columns are not equal.
for eg.
input:
4 5
11 12 13 14 15
21 22 23 24 25
31 32 33 34 35
41 42 43 44 45

your code’s output:
11, 21, 31, 41, 42, 32, 22, 12, 13, 23, 33, 43, 44, 34, 24, 14, 15, 25, 35, 45, -1433391168, 41, 31, 21, END

but the expected output:
11, 21, 31, 41, 42, 32, 22, 12, 13, 23, 33, 43, 44, 34, 24, 14, 15, 25, 35, 45, END

Please reply to the thread when we ask for the link to your code or something, don’t edit it in your already posted problem statement, because we aren’t notified if you update the question and due to this may be your doubt will remain unresolved.