3.18 Short circuit evaluation
(y == 3) || (x > 2) What value of y results in short circuit evaluation, which skips evaluating the second operand? a. 2 b. 4 c. 3
c
(x < 4) && (y > 3) What value of x results in short circuit evaluation, which skips evaluating the second operand? a. 6 b. 2 c. 3
a
(y < 3) || (x == 1) What value of y does not result in short circuit evaluation, such that both operands are evaluated? a. 3 b. 1 c. 2
a
((x > 2) || (y < 4)) && (z == 10) Given x = 4, y = 1, and z = 10, which comparisons are evaluated? a. (x > 2), (y < 4), and (z == 10) b. (x > 2) and (z == 10) c. (x > 2) and (y < 4)
b
(x < 3) && (y < 2) && (z == 5) What values of x and y do not result in short circuit evaluation, such that all operands are evaluated? a. x = 2, y = 2 b. x = 1, y = 0 c. x = 4, y = 1 d. x = 3, y = 2
b