Computer Science, asked by akashbca05, 10 months ago

The precedence order (from highest to lowest) of arithmetic operators is

a)   %, *, /, +, –

 

b)   %, +, /, *, –

 

c)   +, -, %, *, /

 

d)   %, +, -, *, /

Answers

Answered by amikkr
0

Option (a) is the correct option.
The precedence order of arithmetic operators is %, *, /, +, -

  • When an expression is made up of two or more arithmetic operators then the expression is solved using precedence.
  • Precedence can be defined as the priority of that operator.
  • The operator with higher level of precedence will be calculated and evaluated first in the expression.
  • The value with low level of precedence will be calculated later on.
  • The step-by-step evaluation of the operators in the expression is done with the concept of precedence.
  • In arithmetic operations, the priority of the operators like multiplication, division and modulus is greater than addition and subtraction.
  • So, the operators having grater precedence are multiplication (*), division (/) and modulus (%).
  • After these the addition and subtraction operators are evaluated.

So, the order of precedence will be %, *, /, +, -
Option (a) is the correct option.

#SPJ2

Answered by syed2020ashaels
0

Answer: option a that is %,*,/,+,-

Explanation:

When there is more than one arithmetic operator in an expression;  and modulo, division, multiplication, are calculated first, followed by subtraction and addition.

Division, multiplication, and modulus share the same priority, which is higher than the same priority of addition and subtraction. If, in addition, there are operators with the same priority in the expression, then we refer to the associativity of these operators when evaluating the expression.

The precedence of the operator determines how "tightly" it binds two expressions together. For example, in the expression 1 + 5 * 3, the answer is 16 and not 18 because the multiplication operator ("*") has a higher priority than the addition operator ("+"). Parentheses can be used to enforce precedence if needed. For example: (1 + 5) * 3 evaluates to 18.

#SPJ5

Similar questions