Tuesday, April 7, 2020

OPERATORS IN C

OPERATORS IN C

OPERATORS IN C

OPERATORS  IN  C

    Operator  are  symbols  that  act  upto  data. They represent a paticular operation to be performed on the data. Operators can be classified as arithmetical, relation, and assigning operators.

     Arithmetical Operators :  These types of operators denote mathematical operators like – Add, Subtract, Multiple, Divide and Exponentiation.

Operator                    Function
 +                           Addition 

 -                         Subtraction   

 /                           Division  

*                           Multiplication

^                           Exponentiation

%                          Mod (Remainder of                             a division)

      Special Arithmetical Operators :  The - - and + + are known as           decrement and increment operators.
       For example :
x = x + 1;
is equivalent to
++x; or x ++;
Also
x = x – 1;
is equivalent to
- - a; or a - -;
Relational OperatorThese operator are used to compare two values on the basis of a certain condition.
Operator                          Function
       <                                   Less than
 <=                                Less than or equal to
 >                                  Greater than
  >=                               Greater than or equal to
 !=                               Not equal to
   =                                Equal to      
     Logical OperatorsThe logical operators are :
     Operators                                      Function
            &&                                            AND
            ||                                              OR
             !                                                NOT
     Assigning OperatorThe assigning operators are :
     Operators                                      Function
             =                                            Assign a value
            + =                                          Add the values and
                                                           assign it to the left
            - =                                          Sudtract the values
                                                          and assign it to the left
           * =                                           Multiply the values
                                                           and assign it to the left 
           / =                                           Divide the values and
                                                           assign it to the left
         % =                                          Find the remainder                                                                                    and assign it to the left
    Bitwise Operators :  The  Bitwise  Operators are applicable to the char and int data types only .These operators are not useful with float, double, long double, void or other complex data types.

Vibhor Sharma

Author & Editor

###

0 comments:

Post a Comment