& & (boolean AND) has a higher priority than || (logical OR). Therefore, the following are identical:
a || b && c a || (b && c)
A good mnemonic rule is to remember that And as a multiplication, and OR - as an addition. If we replace AND with * and OR with +, we get the more familiar equivalent:
a + b * c a + (b * c)
Actually, in the logical logic, AND and OR act similarly to these arithmetic operators:
aba AND ba * ba OR ba + b
---------------------------------------
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 0 1 1
1 1 1 1 1 1 (2 really, but we pretend it 1)
source share