• Source
    1. #include <iostream>
    2. using namespace std;
    3.  
    4. int main() {
    5. // your code goes here
    6.  
    7. short int _shortInt;
    8. unsigned short int _unsignedShortInt;
    9. int _int;
    10. unsigned int _unsignedInt;
    11. long int _longInt;
    12. unsigned long int _unsignedLongInt;
    13. long long int _longLongInt;
    14. unsigned long long int _unsignedLongLongInt;
    15.  
    16. cout << "byte size of short int: " << sizeof(_shortInt) << endl;
    17. cout << "byte size of unsigned short int: " << sizeof(_unsignedShortInt) << endl;
    18. cout << "byte size of int: " << sizeof(_int) << endl;
    19. cout << "byte size of unsigned int: " << sizeof(_unsignedInt) << endl;
    20. cout << "byte size of long int: " << sizeof(_longInt) << endl;
    21. cout << "byte size of unsigned long int: " << sizeof(_unsignedLongInt) << endl;
    22. cout << "byte size of long long int :" << sizeof(_longLongInt) << endl;
    23. cout << "byte size of unsigned long long int:" << sizeof(_unsignedLongLongInt) << endl;
    24.  
    25. return 0;
    26. }