What will be the output for the following! (1) 20>55||55>20
Answers
Answered by
2
ANSWER.
- true.
EXPLANATION.
We have to evaluate the given expression.
Now,
20 > 55
= false
Again,
55 > 20
= true.
So,
20 > 55 || 55 > 20
= false || true
Since, one condition is true, the result is true,
= true.
LEARN MORE.
Logical Operators -
→ Used to perform logical operations. These operators yield true/false depending.
There are three logical operators –
- Logical AND (Symbol - &&) - Returns true if all the conditions are true else false.
- Logical OR (Symbol - ||) - Returns true if any of the conditions is true. If all the conditions are false, it returns false.
- Logical NOT (Symbol - !) - It is used to negate the result of the conditional expression. Example, !true = false.
Answered by
3
Answer is as follows::
==> '||' means or, therefore, even if one value is true, it will output as True.
==> '&&' is used as and, so, if both the values are true, then only it outputs True, else, it will output False.
Your statement::
20 > 55 || 55 > 20
Output::
It will output True as one of the value is true.
Similar questions