I think I've got a fair measure of what this problem is about.
The operator
| |, as we know, is a short circuit operator. It means that if the result of the operation can be determined by the left hand operand alone, then the right hand operand will be omitted.
In the case of the
| | operator, the truth table is :
- True | | True = True
- True | | False = True
- False | | True = True
- False | | False = False
In our case, the left hand operand of the fourth expression r=(t | | 0<(j+=2)); evaluates to a "True". Since "True" with any combination of True or False returns True for the | | operator, the system decides not to waste its resources in evaluating the Right Hand portion of the operator and just returns True. Consequently, the expression (0<(j+=2)) does not get evaluated and therefore the final value of j is 1.
Hope this helps
Shyam
[This message has been edited by Shyamsundar Gururaj (edited September 09, 2001).]