Beginner in need of help.

I'm really having a hard time understanding how to print pyramids using asterisks. Can someone please explain the procedure step by step?

example of how the pyramid would look like:

        *   
       ***   
      *****   
     *******   
    *********   
   ***********   

1) make a loop which will be executed as many times as there is piramide levels.
2) calculate how many asterisks should be on current level.
3) calculate how many spaces you need to line up asterisks correctly.
4) Output beeded amount of spaces followed by asterisks.
Topic archived. No new replies allowed.