a)Use for loops how to construct a program that displays a pyramid of numbers on the screen.
The pyramid should look like this:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Ask the user to enter a digit(0-9) and display the pyramid with limit up to that number( as shown above).
b)Draw a flowchart for the above program.
Hints
You may nest two inner loops, one to print spaces and one to print numbers (0-9), inside an outer loop that steps down the screen from line to line.
Sample Output
Enter a single digit (1 to 9): 5
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
2006-10-18
09:11:03
·
5 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
Make this code in C or C++
2006-10-18
10:29:55 ·
update #1