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.
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
Join The Discussion