+ 1

Is relational operator skip next operation when the conditions meet false in (&&) or condition meet true in (||)?

int x = 4, y=5; if (++x>4 || ++y>5){ cout<<y } y = 5? or y = 6?

6th Apr 2018, 10:38 AM
Nurman Tajir
Nurman Tajir - avatar
1 Antwort
+ 3
yes, for performance when the result is obvios other conditions skipped so the answer is 5
6th Apr 2018, 10:44 AM
🇮🇷 M N