Brief on Bitwise operator

Answer

Bitwise operator operates on bits and performs bit by bit operations.

Let's look at each one by one:

1. & AND :

0101

0110

______

0100

 

2. | OR

0101

0110

______

0111

 

3. ^XOR

0101

0110

______

0011

 

4. ~ One's component

~0101

_______

1010

 

5. << left shift

4<<1

(0100)<<1

______

1000

 

6. >> right shift

4>>1

(0100)<<1

_______

0010

 

a<<n :- a*2^n

a>>n :-a/2^n

All c++ Questions

Ask your interview questions on c

Write Your comment or Questions if you want the answers on c from c Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---