Advertisement
cd62131

Bits

Feb 16th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main() {
  5.   int a = 55, b = 278;
  6.   cout << showbase << hex << "a = " << a << ", b = " << b << endl;
  7.   a &= b;
  8.   cout << "a = " << a << ", b = " << b << endl;
  9.   b |= a;
  10.   cout << "a = " << a << ", b = " << b << endl;
  11.   a ^= b;
  12.   cout << "a = " << a << ", b = " << b << endl;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement