quick question of triangle shapes

Hey so I have a program that creates a triangle with a user input height. what I need now is to figure out how to add an extra asterisks to the beginning of each line.

what I have now (height=4):
*
**
***
****

what I need:
**
***
****
*****

1
2
3
4
5
6
7
8
9
10
for (int x=1; x<=Height; x++)
	{

		for(int y=1; y<x; y++)
				{
					cout << "*";
				}
		cout << endl;
	}
Last edited on
*edit* oops

*edit #2* I screwed up again :)
line 4: for( int y = 1; y < x+1; y++ )
Last edited on
thanks for the help man, I don't know why I was having such a hard time
Topic archived. No new replies allowed.