Not able to pass 1 test case in Pattern Double Sided Arrow

My code is : https://ide.codingblocks.com/s/208703

I am not able to pass one test case.
Can you please tell the problem in my code.

Also, I am not sure what to print when the value of n in the given question is 1.

@aryanrathee as you may have noticed, the total number of lines printed are equal to n. so in case of n = 1, the output should be
1
whereas in your case it is
1
1