Pattern mountain not able to do

I am not able to print the numbers on the right side. How to deal with it. I am getting 2 “4’s” in the last line.

Hi Anikash, please save your code on ide.codingblocks.com and share the link here. We will tell you where the problem is.

Hey Anikash, you can handle it by using an if check if(row==N) then start printing the second half of pattern from row-1 to 1

https://ide.codingblocks.com/s/55492

Hi Anikash, you just needed to add an if condition for the last row at line number 15.
Also, instead of initialising l with n in the for loop at line number 16, you had to initialise l with n-1.
I have made the changes to your code and you can refer to it here.
https://ide.codingblocks.com/s/55508

1 Like