fork(1) download
  1. #include <iostream>
  2. #include <limits.h>
  3. using namespace std; // consider removing this line in serious projects
  4.  
  5. int main() {
  6. int x = INT_MAX;
  7. cout << x << endl;
  8. cout << x+1 << endl << endl;
  9.  
  10. x = UINT_MAX;
  11. cout << x << endl;
  12. cout << x+1 << endl << endl;
  13.  
  14. x = INT_MIN;
  15. cout << x << endl;
  16. cout << x-1 << endl << endl;
  17.  
  18. unsigned int y = UINT_MAX;
  19. cout << y << endl;
  20. cout << y+1 << endl << endl;
  21.  
  22. y = 0;
  23. cout << y << endl;
  24. cout << y-1 << endl << endl;
  25.  
  26. cout << stoi("101", nullptr, 2);
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0.01s 5276KB
stdin
stdout
2147483647
-2147483648

-1
0

-2147483648
2147483647

4294967295
0

0
4294967295

5