View Single Post
  #1 (permalink)  
Old 07-17-2007, 12:33 AM
romina romina is offline
Member
 
Join Date: Jul 2007
Posts: 26
romina is on a distinguished road
Will make a pyramid of some kind out of a number
Hi, I need to do a program where the user needs to imput a number of lines between 1 and 8 and then the program will make a pyramid of some kind out of a number that is 2^x (1-2-4-8-16 etc). I can calculate and have the numbers but I have no freaking idea how to put them like in the following exemple in the image.

ex :

Number of lines = 4. There's supposed to be 4 space between each column.

Code:
1 1 2 1 1 2 4 2 1 1 2 4 8 4 2 1
I have to do it with "for" loops. Anyone have any idea?
Thanks.
Reply With Quote
Sponsored Links