The proper operator precedence, from first to last, is:

  1. logical, comparison, and arithmetic.

  2. arithmetic, comparison, and logical.

  3. arithmetic, logical, and comparison.

  4. comparison, arithmetic, and logical.

  5. logical, arithmetic, comparison.


Correct Option: B
Explanation:

To solve this question, the user needs to know the order of precedence of operators in an expression. The order of precedence determines the order in which operators are evaluated in an expression.

Now, let's go through each option and explain why it is right or wrong:

A. logical, comparison, and arithmetic: This option is incorrect because logical operations have higher precedence than comparison and arithmetic operations. Therefore, option A has the wrong order of precedence.

B. arithmetic, comparison, and logical: This option is correct. Arithmetic operations have higher precedence than comparison operations, and comparison operations have higher precedence than logical operations. Thus, option B is the correct answer.

C. arithmetic, logical, and comparison: This option is incorrect because logical operations have lower precedence than comparison operations. Therefore, option C has the wrong order of precedence.

D. comparison, arithmetic, and logical: This option is incorrect because comparison operations have higher precedence than arithmetic operations. Therefore, option D has the wrong order of precedence.

E. logical, arithmetic, comparison: This option is incorrect because comparison operations have higher precedence than logical operations. Therefore, option E has the wrong order of precedence.

The Answer is: B. arithmetic, comparison, and logical.

Find more quizzes: