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


Custom Search

C# Source Code » Language Basics » Operator bitwise »

 

Bit operator








    
 
using System;
class Operators {
    static void Main() {
        int a = 10, b = 15, c = 20, d, e, h, i;
        bool f, g, j = (a == b), k;
        d = (a & b);
        e = (a | b);
        f = (j && (b == c));
        g = (j || (b == c));
        h = (a ^ b);
        i = ~b;
        k = !j;
        Console.WriteLine("{0}", d); //10
        Console.WriteLine("{0}", e); //15
        Console.WriteLine("{0}", f); //False
        Console.WriteLine("{0}", g); //False
        Console.WriteLine("{0}", h); //5
        Console.WriteLine("{0}", i); //-16
        Console.WriteLine("{0}", j); //False
        Console.WriteLine("{0}", k); //True
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Operator bitwise