Q. Which of the following operators can operate on a boolean variable?
Code:
1. && 2. == 3. ?: 4. +=
β
Correct Answer: (B)
1, 2 & 3
Explanation: Operator Short circuit AND, &&, equal to, == , ternary if-then-else, ?:, are boolean logical operators. += is an arithmetic operator it can operate only on numeric values.