Precedence of Operators or Hierarchy of Operators In C++

1.  An expression is a combination of opcode and operand.
2.  The operators would be arithmetic, relational, and logical operators.
3. If the expression contains multiple operators, the order in which operations carried out is called the precedence of operators. It is also called as priority or hierarchy.
4.  The Operators with highest precedence appear at the top of the table and those with the lowest appear at the bottom.

What is operator precedence in C++?

* “The order in which different types of operators are evaluated is called as operator precedence”.
* It is also known as hierarchy of operators.
* In any expression, Operators having higher precedence are evaluated first.
* The expression is evaluated in the following sequence.
1. Arithmetic
2. Relational
3. Logical
Previous
Next Post »