R4R
Right Place For Right Person TM
 
R4R CC TutorialsC Basic Tutorials1.5Types Of operators In C Language
 
previous

Home

Next

 

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.

 

previous

Home

Next


Tolal:0 Click:
Show All Comments

Post Your Comments

Your Name:

Your Email ID :
Comments :
URL
  =* Enter SUM

Tutorials,Examples,Questions and Answer

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R