Could someone help me with my hw here is the problem i have and the code "In this exercise, you create a program that uses two nested loops to display two different patterns of
asterisks: Pattern 1 contains nine rows of asterisks as follows: nine asterisks, eight asterisks, seven
asterisks, six asterisks, five asterisks, four asterisks, three asterisks, two asterisks, and one asterisk . Pattern 2 contains nine rows of asterisks as follows: one asterisk, two asterisks, three
asterisks, four asterisks, five asterisks, six asterisks, seven asterisks, eight asterisks, and nine asterisks."
I have the first part done and i need help to add a "do while" loop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#include <iostream>
using namespace std;
int main()
{
int line;
int numAstericks;
for (int line = 1;line <= 9; line += 1)
{
for (int numAstericks = 1; numAstericks <= line; numAstericks += 1)
cout << '*';
//endfor
cout << endl;
}
system("pause");
return 0;
}
|