The logical AND and logical OR operators (&&
and ||
, respectively) exhibit "short-circuit" operation. That is, the second operand is not evaluated if the result can be deduced solely by evaluating the first operand.
...
Although the behavior is well - defined, it is not immediately obvious whether i gets incremented or not.
...