Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <limits>
  3.  
  4. using namespace std;
  5. int main () {
  6.  
  7. int a = std::numeric_limits<int>::min();
  8.  
  9. cout << "Min limit: " << a << endl;
  10. cout << "Min incremented: " << ++a << endl;
  11. cout << "Min decremented: " << --a << endl;
  12. cout << endl;
  13.  
  14. int b = std::numeric_limits<int>::max();
  15.  
  16. cout << "Max limit: " << b << endl;
  17. cout << "Max incremented: " << ++b << endl;
  18. cout << "Max decremented: " << --b << endl;
  19. cout << endl;
  20.  
  21. long c = std::numeric_limits<int>::min();
  22.  
  23. cout << "Long Min limit: " << c << endl;
  24. cout << "Long Min incremented: " << ++c << endl;
  25. cout << "Long Min decremented: " << --c << endl;
  26. cout << endl;
  27.  
  28. long d = std::numeric_limits<int>::max();
  29.  
  30. cout << "Long Max limit: " << d << endl;
  31. cout << "Long Max incremented: " << ++d << endl;
  32. cout << "Long Max decremented: " << --d << endl;
  33. cout << endl;
  34.  
  35. unsigned int e = std::numeric_limits<int>::min();
  36.  
  37. cout << "Unsigned Min limit: " << e << endl;
  38. cout << "Unsigned Min increment: " << ++e << endl;
  39. cout << "Unsigned Min decrement: " << --e << endl;
  40. cout << endl;
  41.  
  42. unsigned int f = std::numeric_limits<int>::max();
  43.  
  44. cout << "Unsigned Max limit: " << f << endl;
  45. cout << "Unsigned Max increment: " << ++f << endl;
  46. cout << "Unsigned Max decrement: " << --f << endl;
  47. cout << endl;
  48.  
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement