Bit Shift operator : Operator bitwise : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Operator bitwise »

 

Bit Shift operator








    
 

using System;

class CompoundBitOpsApp
{
    static void Main(string[] args)
    {
        for (byte j = 0; j < 8; j++)
        {
            byte k = 1;
            Console.WriteLine(
                "1 <<= {0,3} ({1}) = {2,8} ({3,3})",
                Convert.ToString(j, 2), j,
                Convert.ToString((k <<= j), 2), k);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Operator bitwise