The Binary & (AND) Operator - C++ Operator

C++ examples for Operator:Bit Operator

Description

The Binary & (AND) Operator

Demo Code

#include <iostream> 
  
using namespace std; 
int main(int argc, char *argv [])
{ 
        unsigned int first = 0x0F; 
        unsigned int second = 0x18; 
        unsigned int anded = first & second; 
  
        cout << hex << showbase; 
        cout << first << endl; 
        cout << second << endl; 
        cout << anded << endl; 
  
        return 0; 
}

Result


Related Tutorials