Quick actions

cmd+k|ctrl+k

Navigation

Languages

Bit operators / & - bitwise AND / Essential C++

Snippet info

Language

Cpp

Visibility

public

Author

kkowalczyk

Created

2019-03-27T06:44:06Z

Updated

2019-03-27T06:44:06Z

#include <iostream>

int main(int argc, char **argv) {
    int a = 6;     // 0110b  (0x06)
    int b = 10;    // 1010b  (0x0A)
    int c = a & b; // 0010b  (0x02)
    
    std::cout << "a = " << a << ", b = " << b << ", c = " << c << std::endl;
}
INFO