Output is giving garbage values

the code is giving garbage values as output
please help me out

@Tanya25 hey tanya please share your code through cb.lk/ide

Hello @Tanya25,
Please share your code so i can help you to resolve the problem.

@jaiskid can you please tell me that how can i share my code with you ??

Sure,

  1. Paste your code on Coding Blocks IDE.
    Click here.

  2. Save your code.

  3. Share the URL with us.

here is the link https://ide.codingblocks.com/s/103176. on coding blocks ide it is giving the current input .so i dont know why is it not working here

Your code is not passing the testcases because the output format that your code prints is wrong.

Let’s figure this out by the help of an example:
4 4
11 12 13 14
21 22 23 24
31 32 33 34
41 42 43 44
Your code is printing:
11,21,31,41,42,32,22,12,13,23,33,43,44,34,24,14,END
Expected Output:
11, 21, 31, 41, 42, 32, 22, 12, 13, 23, 33, 43, 44, 34, 24, 14, END

Can you see the difference?Observe.

Hint: Also remove the code printing the matrix.
Hope, this would help.
Give a like if you are satisfied.

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.