Right Place For Right Person TM
 Interviews

# C Interview Materials

Types Of operators In C Language

What is an operator:
If we take an expression 9+5=14, here 9 and 5 are operands and + is an operator.

Types of operator :
Arithmetic Operators
Logical Operators
Assignment Operators
Bitwise  Operator
Misc Operator

Arithmetic Operators:
The arithmetic operators are  +, -, *, %, /, ++, --
For ex. If a variable A=10 then A++=11 and A--=9

Logical (or Relational) Operators :
==, !=, >, <, &&, ||, <=, >= are the logical operators.
For Example. If variable A =10 and B=23 then (A=B) is false, (A<B) is true etc.

Bitwise Operators: Bitwise operators works on bits and perform bit by bit operation.
Assume if A = 60; and B = 13; Now in binary format they will be as follows:
A = 0011 1100 and B = 0000 1101
A&B = 0000 1000

Assignment Operators :
=, +=, -=, /=, %= &=, |= etc are the assignment operators.
For Example. C = A + B will assign value of A + B into C and C+= A means C=C+A.

Misc Operators : These are some special kind of operators such as sizeof(), *(Pointer), &(address).
For Example. sizeof (a) means that If a is integer then it returns value 4.
*a means a will be a pointer to 'a' variable.

Tolal:0 Click: