Pages

▼

Tuesday, 18 December 2012

Operators and Operations

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:

  1. Arithmetic Operation: 

    • + -> Addition
    • - -> Subtraction
    • * -> Multiplication
    • / -> Division
    • % -> Modulus (used only in integers)



  2. Relational Operation: 

    • ==> Equal to
    • != -> Not equal to
    • > -> Greater than
    • < -> Less than
    • >= -> Greater than equal to
    • <= -> Less than equal to



  3. Logical Operation: 

    • && > logical AND
    • || -> logical OR
    • | > -> logical NOT



  4. Assignment Operator (=) : 
  • assigns entity to its right to its left.


No comments:

Post a Comment