The question is the following, you are only increasing the value of the variable i
. This way it will vary from 0
until 99
.
These are the truth tables for the logical connectives:
And (&&)
A | B | A && B
--+---+-------
V | V | V
V | F | F
F | V | F
F | F | F
OR (||)
A | B | A || B
--+---+-------
V | V | V
V | F | V
F | V | V
F | F | F
Thus, as can be seen in the operator OU (||)
the two conditions need to be false for the loop to stop. As the variable value j
is never incremented. The loop is infinite thus causing the overflow.
Already on the operator E (&&)
only one of the evaluations needs to be false to make the boolean expression false, and thus interrupt the loop, a fact that will occur only when the value of i
for 100.
Are you modifying j somewhere? and what is your starting value
– Vinicius Macelai
The value of j = 0. Sorry, I already made the correction!
– Bruno V. Martins