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
Need help doing simple project
Need help doing simple project
Nov 16, 2012 at 10:14am UTC
am0n
(42)
Hello, I need to write a code that will display every odd number from 1 to 20.
How do I do it? Thank you.
Nov 16, 2012 at 10:23am UTC
Moschops
(7244)
Make a loop. In the loop, have some number that increases. Each time round the loop, if the number is odd, display it.
Nov 16, 2012 at 10:26am UTC
Darkmaster
(564)
1
2
3
4
for
(
int
i = 0; i<...; ++i) {
int
odd = i * 2 +1; }
you will figure out the rest
Topic archived. No new replies allowed.