Question: c++ Write a program that reads a positive odd whole number n and prints a pyramid where the last row contains all numbers from n

c++

Write a program that reads a positive odd whole number n and prints a pyramid where the last row contains all numbers from n down to 1 (i.e., descending order), the second to last row displays all numbers from n 1 down to 2, the third to last row displays all numbers from n 2 down to 3, etc. The first row will contain only a single value, i.e. the middle value in the range, i.e. n down to 1. Each successive row contains two more values than the previous row. Note: the Pyramid of digits should not be in the middle of the page but on the left-most side.

 c++ Write a program that reads a positive odd whole number

For example, if n is 9, then the program will output: 654 7 65 43 87 654 32 9 8765 4321 If n is 13, then the program will output: 876 98765 0987 654 109 876543 210 987 65 432 32 109 8765 4321

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!