1#include <limits>
2
3int imin = std::numeric_limits<int>::min(); // minimum value
4int imax = std::numeric_limits<int>::max(); // maximum value (2147483647)
1// largest int in c++
2signed int iMax = (unsigned int)~0 >> 1;
3// largest unsigned int
4unsigned int uMax = (unsigned int)~0;
1// max example
2#include <iostream> // std::cout
3#include <algorithm> // std::max
4
5int main () {
6 std::cout << "max(1,2)==" << std::max(1,2) << '\n';
7 std::cout << "max(2,1)==" << std::max(2,1) << '\n';
8 std::cout << "max('a','z')==" << std::max('a','z') << '\n';
9 std::cout << "max(3.14,2.73)==" << std::max(3.14,2.73) << '\n';
10 return 0;
11}