write a program to ask a user for a positive integer n and use nested for loops
Fantastic news! We've Found the answer you've been seeking!
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 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++
Related Book For
Posted Date: