Masking using bit-wise AND Operator


    # include<iostream.h>
    #include<conio.h>
    void main ()
    {
        int a , b ;
        a = 33 ;
        b = a & 3 ;
        cout<<"operand1 = "<<a<<endl ;
        cout<<"Masking value = 3\n";
        cout <<"Masked Value ="<<b ;
        getch( );
    }

0 comments:

Post a Comment

 
 
 
 


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