cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
c++ program for successive adding
c++ program for successive adding
Mar 31, 2018 at 11:59pm UTC
DigiLei
(22)
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
Apr 1, 2018 at 12:05am UTC
Apr 1, 2018 at 12:38am UTC
mbozzi
(3933)
1
2
3
int
sum = 0;
for
(
int
n = 1; sum < 100; n++) sum += n;
Topic archived. No new replies allowed.