Examveda

What is the order of precedence of the logical operators in C?

A. AND, OR, NOT

B. NOT, OR, AND

C. OR, AND, NOT

D. OR, NOT, AND

Answer: Option D

Solution (By Examveda Team)

In C, the order of precedence for logical operators is as follows: OR (||) has the highest precedence, followed by NOT (!), and then AND (&&). This order ensures that expressions are evaluated correctly based on logical conditions.

Option A (AND, OR, NOT) is incorrect because it doesn't follow the correct order of precedence.
Option B (NOT, OR, AND) is also incorrect for the same reason.
Option C (OR, AND, NOT) is incorrect as it doesn't reflect the correct order of precedence for logical operators in C.

This Question Belongs to C Program >> Operators And Expressions

Join The Discussion

Related Questions on Operators and Expressions