Pattern inverted hour glass (doubt)

Here is the corrected code : https://ide.codingblocks.com/s/114412

The mistake you made was that you had put preparatory steps for all variables outside the if-else blocks. So, all your variables were getting incremented or decremented even if their corresponding if-else if block was not running in a particular iteration. And also, in the last else-if block, you had to do β€˜c++’ instead of β€˜c–’. And the last else-if block condition would be β€˜row>n+1’ because you are already running uptil n+1 in above blocks. Have a look at the corrected code for better idea.
I hope your doubt is cleared, if anything is unclear please let me know.

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.