The key to drawing triangles like that is to notice how numbers of characters change on each line.
For example, in
*
**
***
triangle, you see that each line has one more * than the previous one.
So the algorithm would be
1 2 3 4 5 6
int number_of_stars = 1;
for (int i = 0; i < 3; i++) {
draw_stars (number_of_stars);
cout << '\n';
number_of_stars ++;
}