Row wise printing

idk, but my test cases are getting wrong.
though my program is giving correct output for the example in question, but not for the test cases.
how do i share my code?

save your code at ide.codingblocks.com
and send the url generated