I need to do a BASICE For Loop algorithm for a java Pyramid

Posted by user1665119 on Stack Overflow See other posts from Stack Overflow or by user1665119
Published on 2012-09-12T08:30:56Z Indexed on 2012/09/12 9:38 UTC
Read the original article Hit count: 214

Filed under:
|
|
|

Question 2. USE THE FOR LOOP.

Design and write an algorithm that will read a single positive number from the keyboard and will then print a pyramid out on the screen. The pyramid will need to be of a height equal in lines to the number inputted by the operator. Your program is not to test for negative numbers, nor is it to cater for them. For your test, use the number 7. If you would like to take the problem further, try 18 and watch what happens.

Example input:

4

Example output:

               1
              121
             12321
            1234321

© Stack Overflow or respective owner

Related posts about java

Related posts about homework