0

Output After incrementation

https://code.sololearn.com/cEXc4T064307/?ref=app Why does this program output 7? Shouldn’t y be 8 after y++?

24th Apr 2019, 2:36 PM
Bittersweet
Bittersweet - avatar
2 odpowiedzi
+ 4
The problem is that y++ isnt evaluated. The first part of the if is allready false. So it wont evaluate the part behind &&.
24th Apr 2019, 3:10 PM
Dragonxiv
Dragonxiv - avatar
+ 1
Ohh, yes, you‘re right! I totally haven‘t thought about that all. Thanks a lot :)
24th Apr 2019, 3:16 PM
Bittersweet
Bittersweet - avatar