123
int age; short int age; short age;
1234567891011121314151617
#include <iostream> #include <iomanip> #include <limits> using namespace std; int main() { int age = 0; cout << "int: " << sizeof(age) << " min: " << std::numeric_limits<int>::min() << " max: " << numeric_limits<int>::max() << endl; short age2 = 0; cout << "short: " << sizeof(age2) << " min: " << std::numeric_limits<short>::min() << " max: " << numeric_limits<short>::max() << endl; short int age3 = 0; cout << "short int: " << sizeof(age3) << " min: " << std::numeric_limits<short int>::min() << " max: " << numeric_limits<short int>::max() << endl; return 0; }
short