Operators

Operators :

Operator is a symbol which interacts with values and produces some special output. The values on which operators are used are called  Operands.

There are various operators to perform various operations. They are as follows:

  • Arithmetic Operator :

    These are used to perform arithmetic operations like addition, substraction etc.

    Arithmetic Operators

  • Assignment Operator :
    Assignmment Operators

  • Increment and Decrement Operator:

    Increment and Decrement Operator , increment or decrement the values by 1.

    Increment and Decrement Operators

  • Relational Operator :

     Relational Operators

  • Logical Operator :
    Logical Operators

  • Bitwise Operator :
    Bitwise Operators

  • CONDITIONAL OPERATOR( : ? ):

    This operator is based on three operands. These are used as decision making statements( like if-else ). It consists of a ? and :
    Syntax for using :
    (conditon)?(statement1):(statement2);
    In this it condition, if true then statement 1 is executed else statement 2 is executed.
    e.g. 
    x=(23>1)?23:1;

  • sizeof():

    It is used to find the size of any variable or data type in bytes.
    e.g.
    x=sizeof(int);//4
    y=sizeof(char);//1
    z=sizeof(x);//4

Leave a Reply

Your email address will not be published. Required fields are marked *