Problem in last line while printing


this is the code of the above pattern … and in the las line for test case n=4 i am getting 2 fours printed how do i get 1 four instead of 2

Hi @pmschhabra,
just add a seperate case for the last row in the third while loop.
I have updated ur code.
u can hv a look at it to get some idea.


hope dis resolves ur doubt

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.