Https://www.programiz.com/cpp-programming/examples/pyramid-pattern

eg 8
i am attaching my code

@satyamsingla https://ide.codingblocks.com/s/233476

how are spaces =n-i+1. please explain

@satyamsingla you can count the spaces for each line and find the relation for yourself.

i got that. can you please tell me this that for(int i=n ;i>=1;i–) expression prints the first line of pattern or last line? great confusion

@satyamsingla it is the outer for loop, it prints ALL the lines of the pattern, i dont understand what you are trying to ask

i am asking like it starts from bottom or from top for(int i=n ;i>=1;i–)

@satyamsingla the first line is printed first always, so it starts from the top only.

thankyou so much .:slight_smile:

1 Like

@satyamsingla you have multiple threads for this question please mark of them as resolved :slight_smile:

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.