<code>a || b && c</code> is equivalent to
- Acheck_circle
a || (b && c) (because && has higher precedence)
- B
Compile error
- C
(a || b) && c
- D
(a && b) || c
Explanation
<code>&&</code> binds tighter than <code>||</code>.
AP Computer Science A· difficulty 4/5
<code>a || b && c</code> is equivalent to
a || (b && c) (because && has higher precedence)
Compile error
(a || b) && c
(a && b) || c
Explanation
<code>&&</code> binds tighter than <code>||</code>.
Want 10 more like this — adaptive to your weak spots?