I am trying to make a star (*) program while using a couple nested do while loops. The only loops that I want to use are do while loops.
The expected output should be
*
**
***
****
*****
******
*******
********
*********
**********
with the bottom row consisting of 10 stars. I was able to create this code using nested for loops, however I can't seem to do it while using specifically do while loops.
Here's the code using for loops.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main()
{
for (int b = 1; b <= 10; b++) //rows
{
for (int a = 1; a <= b; a++) //columns
cout << "*"; //ouputs the *
cout << endl;
}
system ("pause");
return 0;
}