Question:medium

Which operator has the lowest precedence among logical operators?

Show Hint

Logical operator precedence: \[ \boxed{ ! \;\gt \; \&\& \;\gt \; || } \] where \[ \begin{aligned} ! &\rightarrow \text{Logical NOT}\\ \&\& &\rightarrow \text{Logical AND}\\ || &\rightarrow \text{Logical OR} \end{aligned} \]
Updated On: Jul 23, 2026
  • !
  • &&
  • ||
  • ==
Show Solution

The Correct Option is C

Solution and Explanation

Step 1: Recall the precedence order among these operators.
Among the four listed, the order from highest to lowest precedence is $!$ first, then $==$, then $\&\&$, then $||$ last.
Step 2: Think about why this order makes sense.
Logical NOT applies to a single value so it binds tightest, comparisons like $==$ happen next to form true/false results, then AND combines conditions more tightly than OR combines them.
Step 3: Pick out the lowest one.
Since OR is evaluated only after everything else has been resolved, it sits at the bottom of the precedence list.
\[ \boxed{||} \]
Was this answer helpful?
0