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
C program to display the nlevel pyramid incl... View full answer
Get step-by-step solutions from verified subject matter experts
