CodesandTutorials
Next generation website theme is here (black, neon and white color) - Reduces eye strain and headache problems.
You are here - Home > Programming > C > Basics

Shift Operators


Description

Shift operators shifts the binary bit value of a given number to left or right side.

Types

Left shift operator

  • It is represented by '>>' operator.
  • It shifts each bit to the left by adding 0 to the right of the binary number
  • Eg: Before - 0101001
    After - 1010010

Right shift operator

  • It is represented by '<<' operator.
  • It shifts each bit to the right by adding 0 to the left side.
  • Eg: Before - 0101001
    After - 0010100

Tip Box

Operator precedence

Priority Operator
1st <<
2nd >>

Advertisement





Terms of Use | Privacy Policy | Contact Us | Advertise
CodesandTutorials © 2014 All Rights Reserved