Advertisements
Advertisements
Question
Which of the following is the correct precedence of logical operators?
Options
!, &&, ||
&&, !, ||
||, !, &&
&&, ||, !
MCQ
Solution
!, &&, ||
Explanation:
- ! (logical NOT) has the highest precedence.
- && (logical AND) comes next.
- || (logical OR) has the lowest precedence.
shaalaa.com
Is there an error in this question or solution?