Question: write a program to ask a user for a positive integer n and use nested for loops to print an n-level pyramid of asterisks. For

write a program to ask a user for a positive integer n and use nested for loops to print an n-level pyramid of asterisks. For example, if n = 4, the pyramid should look like:

∗ ∗ ∗

∗∗ ∗ ∗∗

∗ ∗ ∗ ∗ ∗ ∗ ∗

The number of spaces before the asterisks on each line should be adjusted to create the pyramid shape. Hint: you can use one loop for managing the rows and another loop for managing the spaces and asterisks in each row. C++

Step by Step Solution

3.42 Rating (174 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

C program to display the nlevel pyramid incl... View full answer

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 Programming Questions!