Question) x = false; y = true; What is the result of x && y
Options)
- True
- False
Explanation) This is a straightforward question. Lets revise the entire table once -
x y x&&y
true true true
true false false
false true false
false false false
So basically in expression1&&(and)expression2, entire expression is false if any one of the expressions or both are false. On the other hand this evaluates to be true only when both expressions are true.
Our question represents 3rd row of the above table.The answer is therefore False.
No comments:
Post a Comment