+ 1

Can anyone explain this to me easily

bool t = true; bool f = false; bool cond = !t && (f || t) || (t && !f); if (cond) cout << "1"; else cout << "0";

31st Aug 2020, 9:09 PM
Bayzid
Bayzid - avatar
2 Respostas
+ 4
Parenthesis are always treated first.They have priority.so then cond or condition : !t &&(f||t) ==> not true and true ==> false false || (t&&!f) ==> false ou true ==> true so cond is true output will be I
31st Aug 2020, 9:23 PM
HBhZ_C
HBhZ_C - avatar