Priority of logical operators | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Priority of logical operators

Do those logical operators (like &&, ||, and !) have some priorities over each other? Or do they just follow the left-to-right sequence while the code is read (unless there are parentheses)?

16th Feb 2017, 2:52 PM
夏ē›®ć®Rain_Li
夏ē›®ć®Rain_Li - avatar
1 Resposta
+ 3
AFAIK, && has higher precedence than ||. ! acts only on its right member, so it has the highest precedence of them 3.
16th Feb 2017, 3:26 PM
Ɓlvaro