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):

  1. A.

    C, D, E, B, A

  2. B.

    C, A, D, E, B

  3. C.

    C, D, A, E, B

  4. 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):

  1. Shift operator (>>)

  2. Relational operator (>=)

  3. Logical AND (&&)

  4. Conditional operator (?:)

  5. 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.

Explore the full course: Mppsc Assistant Professor