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
Codeblocks help!
Codeblocks help!
Feb 18, 2014 at 3:58am UTC
Poetix33
(9)
I need to generate the even numbers from 10 to 30 (inclusive)
I'm having struggles on what code to write for it. If anyone could write the code for me, just so I have a basic concept it and apply it similarly for other tasks i have to do.
Feb 18, 2014 at 4:11am UTC
long double main
(999)
The easiest way is probably to use a
for
loop from
i=
10 to 30 and have
i
go up by 2 each time:
1
2
for
(
int
i = 10; i <= 30; i += 2)
// Work with i here
Topic archived. No new replies allowed.