#include #include #include #include using namespace std; const int BITS_PER_BYTE{8}; int main() { int bytes{0}; int bits{0}; long computation; int i {INT_MAX}; cout << "An integer is between " << INT_MIN << " and " << INT_MAX << endl; bytes = sizeof(int); bits = bytes * BITS_PER_BYTE; cout << "That is because the size is " << bytes << " bytes." << endl; cout << "\tor " << bits << " bits." << endl; computation = pow(2, bits-1); cout << "Because 2^" << bits-1 << " = " << computation << endl; cout << endl; cout << i << " + 1 = " << i+1; cout << ", this is called overflow " << endl; cout << endl; i = 010; cout << " i = 010 produces " << i << endl; cout << " 0x1f is " << 0x1f << endl; cout << endl; cout << "INT_MAX + 1 = " << INT_MAX + 1 << endl; cout << "INT_MIN - 1 = " << INT_MIN - 1 << endl; return 0; return 0; }