Shift Operators : Shift operator : Operator C# Examples


C# Examples » Operator » Shift operator »

 

Shift Operators









    
using  System;

class  MainClass
{
      static  void  Main()
      {
            int  a,  b,  x  =  14;
            a  =  x  <<  3;            //  Shift  left
            b  =  x  >>  3;            //  Shift  right
            Console.WriteLine("{0}  <<  3  =  {1}",  x,  a);
            Console.WriteLine("{0}  >>  3  =  {1}",  x,  b);
      }
}
    
   
  
   



Output

14 > 3 = 1


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Operator
» Shift operator