Assume that count is 0, total is 20 and max is 1. The following statement will do which of the following? if
(count != 0 && total / count > max) max = total / count;
a) The condition short circuits and the assignment statement is not executed
b) The condition short circuits and the assignment statement is executed without problem
c) The condition does not short circuit causing a division by zero error
d) The condition short circuits so that there is no division by zero error when evaluating the condition,
but the assignment statement causes a division by zero error
e) The condition will not compile because it uses improper syntax
Answer: a. Explanation: Since count is 0, (count != 0) is false. Because the left-hand side of an && condition is false, the condition is short circuited, and so the right-hand side is not evaluated. Thus, a potential division by zero error is avoided. Because the condition is false, the statement max = total / count is not executed, again avoiding a potential division by zero error.