Computer Science, asked by deepalunthi878, 5 months ago

7. The hierarchy in which the operators are executed in Basic expression is called

Answers

Answered by gugulothsharada77
9

Explanation:

Hierarchy Of Operations

In a programming language, when an expression involves multiple operations, the hierarchy of operations instructs the compilers and interpreters on the order in which the expression has to be executed. Usually, the expression consists of operations like, addition, subtraction, multiplication, division, exponents, and parentheses.

The hierarchy of operations is as follows:

• Parentheses ()

• Exponents

• Multiply or Divide

• Addition or Subtraction

Parentheses

Execution of the expressions inside the parentheses starting from the innermost parenthesis. Other than parentheses the special characters like brackets [ ], braces { } and square root also fall under this category.

Exponents

After solving the operations in the parentheses, choose the exponents for execution.

Multiplication or Division

The order of multiplication and division in an expression has the third priority. Perform the multiplication or division operation in the left to right order.

Addition or Subtraction

The order of addition or subtraction in an expression has the last priority. Perform the addition or subtraction operation in the left to right order.

Example:

Solve the following expression:

a = 3*2/2+2/2+6-1+5/8

a = 3*2/2+2/2+6-1+5/8

a = 6 / 2 + 2 /2 + 6 - 1 + 5 / 8

operation: *

a= 3 + 2 / 2 + 6 - 1 + 5 / 8

operation: /

a = 3 + 1+ 6 - 1 + 5 / 8

operation: /

a = 3 + 1 + 6 - 1 + 0

operation: /

a = 4 + 6 - 1 + 0

operation: +

a = 10 - 1 + 0

operation: +

a = 9 + 0

operation: -

a = 9

operation: +

Answered by tandrachakra
0

Answer:

Bedmas is the hierarchy in which the operators are executed in Basic expression

Similar questions