Search This Blog

Thursday, 14 March 2013

Bitwise operators



....Bit-wise Operators
Bit-wise operators are used to perform operations on bits (0’s and 1’s)
Of values . This operators are used for testing the bits or shifting them right to left.The bit-wise operators are as follows
Operator
Name
Meaning

~

Compliment operator


Converts 0’s into 1’sand 1’s into 0’s

<< 

Left –Shift operator

Moves bits towards left side and 0’s as added from Right

>> 
Right –Shift Operator
Moves bits towards right side and 0,s are added from left
&
AND operator
If both the bits are 1’s , it returns true otherwise returns 0
|
OR operator
If both or any one of two bits is 1 then it returns 1 otherwise returns 0
^
Exclusive-OR
Returns 1 if any one of bits is 1 otherwise 0

0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Hostgator Discount Code