Here's what I need to do! I need to write a nested loop code segment that produces the following output:

1
1 2
1 2 3
1 2 3 4
I know that this is elementary to most of you. I know how to make the program increment numbers:
int i = 1;
while(i < 5)
{
cout << i <<endl;
i++;
}

but how do get it to go back to 1 and inrement to 2 then on the next line 1 2 3, etc. I know I need to nest the loops but I am fairly new to loops, I am a beginner, and not sure how to make it produce the output listed above. I am not asking anyone to do this program for me only asking for some hints and direction. THANK YOU!!!!