fork(3) download
  1. #include <iostream>
  2.  
  3. int main ()
  4. {
  5. int x=0xA5, y=0x57;
  6.  
  7. std::cout << "0x" << std::hex << (x & y) << std::dec << std::endl;
  8. std::cout << "0x" << std::hex << (x | y) << std::dec << std::endl;
  9. std::cout << "0x" << std::hex << (~x | ~y) << std::dec << std::endl;
  10. std::cout << "0x" << std::hex << (x & !y) << std::dec << std::endl;
  11. std::cout << "0x" << std::hex << (x && y) << std::dec << std::endl;
  12. std::cout << "0x" << std::hex << (x || y) << std::dec << std::endl;
  13. std::cout << "0x" << std::hex << (~x || ~y) << std::dec << std::endl;
  14. std::cout << "0x" << std::hex << (x && ~y) << std::dec << std::endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 2728KB
stdin
Standard input is empty
stdout
0x5
0xf7
0xfffffffa
0x0
0x1
0x1
0x1
0x1