Compound Boolean Expressions

AP Computer Science A· difficulty 4/5

<code>a || b && c</code> is equivalent to

  • A

    a || (b && c) (because && has higher precedence)

    check_circle
  • B

    Compile error

  • C

    (a || b) && c

  • D

    (a && b) || c

Explanation

<code>&&</code> binds tighter than <code>||</code>.

Want 10 more like this — adaptive to your weak spots?

Related questions