Beginner in need of help.

Oct 12, 2014 at 10:57am
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:

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

Oct 12, 2014 at 11:03am
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.