Question
Using only the following create a pyramid design composed of asterisks as shown below. For this program you cannot do a simple series of cout
Using only the following create a pyramid design composed of asterisks as shown below.
For this program you cannot do a simple series of cout statements with string constants like:
cout
This will work but it doesn't help you advance your programming skills. Instead assume that you have the variables:
char star = '*' ; char blank = ' ' ;
Now use cout
For example the following loop prints a series of 5 asterisks followed by 5 blanks repeated three times:
for (i =1; i
{
cout
}
Output:
***** ***** *****
You will need to set up a loop to print out the number of rows in the design. The number of rows may be hard coded to some number like 10 or you may allow it to be an input.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started