The correct answer is: C. relational, arithmetic, assignment
In the absence of parentheses, the order of evaluation of operators in an expression is as follows:
- Relational operators (<, >, <=, >=, ==, !=)
- Arithmetic operators (+, -, *, /, %)
- Assignment operators (=)
For example, in the expression a = b + c
, the +
operator will be evaluated first, then the =
operator.
Here is a table that summarizes the order of evaluation of operators in expressions:
| Operator | Precedence |
|—|—|
| Relational operators | 1 |
| Arithmetic operators | 2 |
| Assignment operators | 3 |
Note that the order of evaluation of operators can be changed by using parentheses. For example, in the expression (a + b) = c
, the +
operator will be evaluated before the =
operator.