Jan 22, 2014 at 3:28am UTC
Last edited on Jan 22, 2014 at 3:29am UTC
Jan 22, 2014 at 3:37am UTC
So,
0
2
6
8
10
12
Thank you for the help.
Jan 22, 2014 at 4:01am UTC
Sorry, I forgot to mention it in my first reply, but the output would actually be
02681012
with no spaces or line breaks, since the only thing you're giving cout to display is the value.
Feb 25, 2014 at 11:29am UTC
The loop ends when the condition becomes false.
The condition is
(i < 7 )
, not
((2 * i) < 7)
.
Also, why is everyone skipping over the output for when i is 2?
The output will be:
Last edited on Feb 25, 2014 at 11:30am UTC
Feb 26, 2014 at 8:44am UTC
@MikeyBoy
Ooops ! + *facepalm* (On my part)
That's really embarrassing - good thing there are people who DO know what they are talking about!!
Cheers
Feb 26, 2014 at 11:02am UTC
No worries - if I had a penny for every little slip I've made in my career as a C++ developer, I would be rich enough to no longer need to have that career :)