Interview Questions   Tutorials   Discussions   Programs   Videos   

C++ - Difference between shift left and shift right.




262
views
asked marvit August 18, 2014 11:44 AM  

Difference between shift left and shift right.


           

1 Answers



 
answered By bhjahnavi   0  
the left shift 
The left-shift operator causes the bits in 
shift-expression to be shifted to the left by the number of positions specified by additive-expression. The bit positions that have been vacated by the shift operation are zero-filled.
the right shift
The right-shift operator causes the bit pattern in shift-expression to be shifted to the right by the number of positions specified by additive-expression. For unsigned numbers, the bit positions that have been vacated by the shift operation are zero-filled. 
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert