Computer Science, asked by Debu705, 1 year ago

evaluate the following expression according to operator precedence used in c, 10-3%8+6/4

Answers

Answered by adityaeng
9
10-3%8+6/4

10-3+6/4

10-3+1

7+1

8
Answered by monica789412
0

When more than one operator is used in the expression, Operator precedence helps in determining which operator is used first.

So the expression is evaluated as:

The given expression is 10-3%8+6/4

  • Firstly the '%' operator is used from left to right and the expression after evaluation becomes:

          10-3+6/4

  • Then further the '/' operator is used from left to right and the expression after evaluation becomes:
  •          10-3+1
  • Then the '-' operator is used from left to right and the expression after evaluation becomes:
  •   7+1
  • At last, the final answer become

           8

So after, evaluating the expression the final answer becomes 8.

Similar questions