About Me

Hey friends! My name is yuvraj basnet. I'm going to introduce myself.I have born and grown up in india(chandigarh) and I'm studying second year of B.C.A computer science field. My father serving in indian air force. My mother has been taking care of house hold. I am a friendly person, good thinker, I can work for longer hours without any break, only if I'm interested in that...My life style is very simple.

PART II OPERATORS IN C

In the previous tutorial I will explain you operators now in this tutorial you learn 
others operators in c programming.




2)RELATIONAL OPERATORS:

Relational operators are those operators which is for comparision of two

operands and return the result in 1 and 0.


    Example-
    
   OUTPUT
    

3)LOGICAL OPERATORS:
It is most often used to test whether a certain condition between the 
statements or value is true or false.

   Example-

   OUTPUT



4)BITWISE OPERATORS:
During computation of variables, mathematical operations like: addition, 
subtraction, addition and division are converted into bit-level and 
1's and 0's is known as bitwise operator.
   Example-

    OUTPUT
 

5)OTHER OPERATORS USE IN C:
i)Comma operatorComma operators are used to link related expressions
  together. For example int a, b=4, c;

ii)Size of operator: The size of operator is a unary operator which return 
    the size of data (array ,variable ,constant e.t.c).

Example-

    OUTPUT

6)TERNARY OPERATOR:
Ternary operator is a conditional operator that works on 3 operands.

Conditional Operator Syntax:

conditonalExpression ? expression1 : expression2;  

PRECEDENCE OF OPERATORS-   
If more than one operator are involved in an expression, C 
language has a predefined rule of priority for the operators. 
This rule of priority of operators is called operator precedence.

Example-

   OUTPUT

ASSOCIATIVITY OF OPERATORS:
if two operators of same precedence (priority) is present in 
an expression, Associativity of operators indicate the order 
in which they execute.

         Summary of C operators with precedence and associativity

Post a Comment

0 Comments