> How do i make this code repeat to make 2 triangles instead of just one?

How do i make this code repeat to make 2 triangles instead of just one?

Posted at: 2014-12-18 
Add an outer for loop iterating twice. You'll have a triply nested for loop.

for(i = 1; i <= 2; i++)

{

for(b = 1; b <= 10; b++)

{

for(a = 1; a <= b; a++)

{

cout << "*";

}

cout << endl;

}

}

#include

#include

using namespace std;

int main()

{



for(int b=1;b<=10;b++)







//for loop b is controlling the number of lines of*'s on screen

{



for(int a=1;a<=b;a++)





cout <<"*";

// FOR Loop A is controlling the number of *'s on the screen

cout << endl;

}

system ("pause");

return 0;

}