Program to demonstrate Bitwise Logical operators

/* Program to demonstrate Bitwise Logical operators */

class BitLogic
{
    public static void main(String args[])
    {
        int A=35,B=15,C=3;
        System.out.println("A is : "+A);
           System.out.println("B is : "+B);
        System.out.println("A | B  is : "+(A|B));
        System.out.println("A & B  is : "+(A&B));
        System.out.println("A ^ B  is : "+(A^B));
                int D = ~C & 0x0f;
        System.out.println(" ~ C is : "+D);


    }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|