fork download
  1. #include <iostream>
  2. #include <bitset>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. char c = 127;
  8. std::cout << (int)c << " = " << std::bitset<8>(c) << std::endl;
  9. c++;
  10. std::cout << (int)c << " = " << std::bitset<8>(c) << std::endl;
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
127 = 01111111
-128 = 10000000