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
confused!
confused!
Jan 24, 2015 at 9:36am UTC
theposibility
(36)
why is the output of this program is
0
1
1
1
i set x = 0; i dont understand how it gets 1
1
2
3
4
5
6
7
8
y=5;
for
(x=0; x<y; x++) { cout<<(x)<<endl; x=0; y--; }
Jan 24, 2015 at 9:58am UTC
MiiNiPaa
(8886)
Line 5: x is set to 0
Line 8: x is incremented to 1 and loop starts again
Line 4: x (1) is outputted
Line 5: x is set to 0
...
Last edited on
Jan 24, 2015 at 9:58am UTC
Topic archived. No new replies allowed.