c++ program for successive adding

How do I make a program add successive numbers starting with one until the sum is greater than or equal to 100? I know I need a loop for this one, just not sure.
Last edited on
1
2
3
int sum = 0;  
for (int n = 1; sum < 100; n++) 
  sum += n;
Topic archived. No new replies allowed.