Does the following sequence produce division by zero?
j = −1;
If ((j > 0) && (1/(j+1) > 10))
cout << i << endl;
The Boolean expression j > 0 is false (j was just assigned -1).
The && uses short-circuit evaluation, which does not evaluate the second expression if the truth value can be determined from the first expression.
The first expression is false, so the entire expression evaluates to false without evaluating the second expression. So, there is no division by zero.