Arithmetic Expressions :
Print this page
 

Arithmetic expressions are expressed as combinations of:

1. Operands
2. Operators (arithmetic, Boolean, relational operators)

Various rules have been formulated to specify the order of evaluation of combination of operators in any expression.

The arithmetic expressions are expressed in 3 different notations:

1. Infix :
  • In this if the operator is binary; the operator is between the 2 operands.
  • And if the operator is unary, it precedes the operand.
2. Prefix :
  • In this notation for the case of binary operators, the operator precedes both the operands.
  • Simple algorithm using stack can be used to evaluate the final answer. 
3. Postfix :
  • In this notation for the case of binary operators, the operator is after both the corresponding operands.
  • Simple algorithm using stack can be used to evaluate the final answer.
Always remember that the order of appearance of operands does not change in any Notation. What changes is the position of operators working on those operands.
Prev