**<< is bitwise left shift operator .It shifts the binary equivalent buy specified number of bits to left.If we shift by one bit to left then it is equivalent to multiplying a number by 2.**

**>> is bitwise right shift operator.It shifts the binary equivalent buy specified number of bits to right.If we shift by one bit to left then It is equivalent to dividing a number by 2.**

**ex:-**

**int x=24,y,z;**

**y=x>>1;**

**z=x<<1;**

**then y=12 and z=48…**

**So we can use these operators in place of %(mod) and /(div) operators….**

**Suppose we want to find remainder and divisor when we divide a number by 2 thn**

**d=n>>1; //gives the divisor**

**r=n-((n>>1)<<1); //gives the remainder**

Advertisements