bitwise NOT for hexadecimal : Bitwise NOT : Data Type C# Examples


C# Examples » Data Type » Bitwise NOT »

 

bitwise NOT for hexadecimal









    
class  MainClass
{

    public  static  void  Main()
    {

        byte  byte1  =  0x9a;    //  binary  10011010,  decimal  154
        byte  byte2  =  0xdb;    //  binary  11011011,  decimal  219
        byte  result;

        System.Console.WriteLine("byte1  =  "  +  byte1);
        System.Console.WriteLine("byte2  =  "  +  byte2);

        
        result  =  (byte)  ~byte1;
        System.Console.WriteLine("~byte1  =  "  +  result);
    }

}
    
   
  
   



Output

byte1 = 154
byte2 = 219
~byte1 = 101


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Bitwise NOT