0
Pls explain the last line (i.e:cout<<(x<5)+1;)
{int x=3; If(x==2) cout<<"0"; else cout<<"4"; cout<<(x<5)+1;} ....Ans:42
3 Answers
+ 1
booleans FALSE and TRUE are 0 and 1 so TRUE is 1 and FALSE is 0 so since (x < 5) is TRUE it becomes 1 and 1 + 1 is 2
+ 2
x<5 is True means 1 as int type. So
1+1 = 2 is printed.
Else part prints 4 before.
0
Thanks to all.Got itđ€