The priority of precedence in which the operations in an arithmetic statement are performed is called hierarchy of operations.
priority |
operations |
Description |
1st |
* / % |
Multiplication, division,modular division |
2nd |
+ - |
Addition, subtraction |
3rd |
= |
Assignment |
Opeartors and expressions:
Arithmetic Operation:
-
+ -> Addition
- - -> Subtraction
- * -> Multiplication
- / -> Division
- % -> Modulus (used only in integers)
Relational Operation:
-
==> Equal to
- != -> Not equal to
- > -> Greater than
- < -> Less than
- >= -> Greater than equal to
- <= -> Less than equal to
Logical Operation:
-
&& > logical AND
- || -> logical OR
- | > -> logical NOT
- Assignment Operator (=) :
- assigns entity to its right to its left.
No comments:
Post a Comment