Program 5: Data Types
Using the sizeof command, write a program in C++ to find the size of fundamental data types. Provide the screenshot of the output of your code that should look similar to the below chart:
The size of fundamental data types:
- The sizeof(char) is 1 byte
- The sizeof(short) is 2 bytes
- The sizeof(int) is 4 bytes
- The sizeof(long) is 8 bytes
- The sizeof(long long) is 8 bytes
- The sizeof(float) is 4 bytes
- The sizeof(double) is 8 bytes
- The sizeof(long double) is 16 bytes
- The sizeof(bool) is 1 byte