Whenever the "&&" operator is used, such as in: exp1 && exp2 where exp1 and exp2 are boolean expressions, both the boolean expressions are not always evaluated

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, you need to understand how the "&&" operator works in boolean expressions.

The "&&" operator is known as the logical AND operator. It returns true if both of its operands are true, and false otherwise.

In the expression "exp1 && exp2", the "&&" operator uses short-circuit evaluation. This means that if the value of exp1 is false, the value of exp2 is not evaluated because the overall result of the expression will already be false. This is because for the logical AND operator to return true, both operands must be true.

Therefore, when using the "&&" operator, if exp1 evaluates to false, exp2 is not evaluated, thus saving unnecessary computation.

Hence, the statement "both the boolean expressions are not always evaluated" is true.

The correct answer is A) True.

Find more quizzes: