Add a pair of parentheses to each expression so that it evaluates to True. a) 0 == 1 == 2 b) (2 + 3) == (4 + 5) == 7 c) (1 < -1) == (3 > 4)
Question
Add a pair of parentheses to each expression so that it evaluates to True.
a) 0==1==2
b) 2+3==4+5==7
c) 1<-1==3>4
✨ Free AI Tools for You
Powered by Chatterbot AI
Answer
Here are the expressions with parentheses added so that they evaluate to True:
a) 0 == (1 == 2)
b) (2 + 3 == 4) + 5 == 7
c) 1 < (-1 == 3 > 4)
To explain each one:
In (a), the inner expression
(1 == 2)
evaluates toFalse
, making the comparison0 == False
, which isTrue
.In (b), the inner parenthesis forces
2 + 3 == 4
to be evaluated asFalse
, which is effectively0
, resulting in5 == 7
after addition.In (c),
3 > 4
isFalse
, and-1 == False
isTrue
, then the comparison1 < True
is alsoTrue
.
India's 1st AI Doubt Solver for CBSE, JEE, and NEET
Ask a Question for Freeand then it's just ₹212 a month