posted 19 years ago
&& and || operators are short circuit logical operators. It means in
if A is false, B is not evaluated. (Because there is no chance the result to be true if A is false)
In your example 1. passingScore is assigned to false and being evaluated, because it is false, grade==70 is not evaluated.
(In the second one & operator is not a schort circuit operator, rather bitweise and)
hope this helps