The user will enter the number of '*'s on the 1st row (ntop) and then the number of rows forming the trapezoid (nrows). (using <iostream>, cout)
For instance, an inverted trapezoid with 7 '*"s in the 1st row and 3 rows forming the
inverted trapezoid looks like:
(this pyramid is centered, in case it isnt when its posted). Also, each descending row has two less asteriks than the above row.
im having trouble with the four loop displaying the number of "*" and " ". I know its a relationship with variables in the for loops, my output is just never doing what i want it to.
THis is the guideline for the for loop:
Use for loops to display the inverted trapezoid. Your outer for loop will iterate
the total number of rows times. For each row use one nested for loop to display
blanks (the 1st row contains no blanks) and another nested for loop to display
the characters '*'.
Heres my for loops so far:
for (i = nrows; i >= 1; i--)
for (j = 0; j >= nrows; j++)
cout << " ";
for (k=ntop; k >= 2; k--)
cout << "*";
The 7 was just an example. The user inputs the number of asterisk In the top row and the number of rows. So I don't think I'm going to be able to assign destination values like 7 and 3 to a. I think I have to is one for loop for number of blank spaces and another for loop for number of asterisk. That's the problem I'm having.