Originally posted by archana prabhu: b1=true,b2=true,b3=false b3&=b1|b2->this evaluates to false b3=b3&b1|b2->this evaluates to true why does it give different result?

| has a higher precedence than &=

so b3 &= b1|b2 is the same as b3 &= (b1|b2) which is b3 &= true which is false since b3 is false.

& has a higher precedence than |

so b3 = b3 & b1 | b2 is the same as b3 = (b3 & b1) | b2 = false | true = true.