Consider the operators used in C Programming given below: A. && B. += C. >> D.…
2025
Consider the operators used in C Programming given below:
A. &&
B. +=
C. >>
D. >=
E. ?:
Choose among the following the correct order of precedence of the operators given above (higher to lower):
- A.
C, D, E, B, A
- B.
C, A, D, E, B
- C.
C, D, A, E, B
- D.
D, C, A, B, E
Attempted by 513 students.
Show answer & explanation
Correct answer: C
Answer: >>, >=, &&, ?:, +=
Explanation:
The shift operator (>>) has higher precedence than relational operators.
Relational operator (>=) is evaluated before logical AND (&&).
Logical AND (&&) binds more tightly than the conditional operator (?:).
The conditional operator (?:) is evaluated before assignment and compound assignment operators (like +=).
Assignment and compound assignment (+=) have the lowest precedence among these operators.
Evaluation order (highest to lowest):
Shift operator (>>)
Relational operator (>=)
Logical AND (&&)
Conditional operator (?:)
Assignment / compound assignment (+=)
Short example: In an expression like a >> b >= c && d ? e : f += g, evaluation follows the order above: >> first, then >=, then &&, then ?:, and finally the assignment.
A video solution is available for this question — log in and enroll to watch it.