Section 8.10 - CSE110 - Principles of Programming - ZyBooks
Section 8.10 - CSE110 - Principles of Programming - ZyBooks
! (logical
! NOT) is ! x || y is evaluated as (!x) || y
next
Arithmetic
operators
(using their
*/%+- precedence z - 45 * y < 53 evaluates * first, then -, then <.
rules; see
earlier
section)
x == 0 && x != 10 is evaluated
Equality and as (x == 0) && (x != 10) because == and != have
== != inequality precedence over &&.
operators == and != have the same precedence and are evaluated left
to right.
x == 5 || y == 10 && z != 10 is evaluated
&& Logical AND as (x == 5) || ((y == 10) && (z != 10)) because
&& has precedence over ||.
https://learn.zybooks.com/zybook/2025SpringA-X-CSE110-13743_2/chapter/8/section/10 1/1