+ 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";
1 Odpowiedź
+ 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