The question is as follows, you are incrementing only the value of the i
variable. This way it will vary from 0
to 99
.
These are the true tables for the logical connectives:
E (& &)
A | B | A && B
--+---+-------
V | V | V
V | F | F
F | V | F
F | F | F
OU (||)
A | B | A || B
--+---+-------
V | V | V
V | F | V
F | V | V
F | F | F
Thus, as can be seen in the OU (||)
operator, both conditions must be false for the loop to stop. Because the value of the j
variable is never incremented. The loop is infinite causing the overflow.
In the E (&&)
operator, only one of the evaluations must be false to make the Boolean expression false, and thus break the loop, a fact that will occur only when the value of i
is 100.