+ 4

How this code show output 1211 😨😨😨

#include <iostream> using namespace std; int main() { int x=1,y=1,z=1; cout<<(++x||++y&&++z); cout<<x<<y<<z; return 0; }

17th Jan 2018, 1:08 PM
Devendra kandpal
Devendra kandpal - avatar
2 Answers
+ 4
++x is 2, equivalent to True. Hence the && expression isn't evaluated. Hence, the first output is 1. Since only x is incremented, the rest of the output is 211
17th Jan 2018, 1:46 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
what you want to show
17th Jan 2018, 1:41 PM
Max bax
Max bax - avatar