Question: 1.1 - Program output Your program should get the size and range of the integer and floating point datatypes, check if they match, and print

 1.1 - Program output Your program should get the size and

1.1 - Program output Your program should get the size and range of the integer and floating point datatypes, check if they match, and print the results to the screen. The integer datatypes include [bool, char, short, int, long, long long], and their unsigned varieties. Use the compiler constants included in the climits.h file such as INT_MAX, SHRT_MIN, etc. Your program should display the compiler constants and the calculated min/max range for each datatype. For example, an integer should have a size of 4, which is 4 bytes, sizeof(int) should return 4. Each byte is 8 bits, so it's a 32-bit integer. 2^32 = 4294967296 so a 4 byte integer can store a number between 0 and 4294967295. So you'd have your program print something like this (notice you'll have to deal with signed and unsigned integers, and that you start counting at 0, not 1!) 1 To use the power function, you will need to include the cmath.h header and use the pow (base, exponent) function. [short int] size is 2 bytes. Calculated range [-32768, 32767]. Constant range [-32768, 32767] [unsigned short int] size is 2 bytes. Calculated range [0, 65535]. Constant range [0, 65535] [int] size is 4 bytes. Calculated range [-2147483648, 2147483647]. Constant range [-2147483648, 2147483647] (unsigned int] size is 4 bytes. Calculated range [0, 4294967295]. Constant range [0, 4294967295] 1.1 - Program output Your program should get the size and range of the integer and floating point datatypes, check if they match, and print the results to the screen. The integer datatypes include [bool, char, short, int, long, long long], and their unsigned varieties. Use the compiler constants included in the climits.h file such as INT_MAX, SHRT_MIN, etc. Your program should display the compiler constants and the calculated min/max range for each datatype. For example, an integer should have a size of 4, which is 4 bytes, sizeof(int) should return 4. Each byte is 8 bits, so it's a 32-bit integer. 2^32 = 4294967296 so a 4 byte integer can store a number between 0 and 4294967295. So you'd have your program print something like this (notice you'll have to deal with signed and unsigned integers, and that you start counting at 0, not 1!) 1 To use the power function, you will need to include the cmath.h header and use the pow (base, exponent) function. [short int] size is 2 bytes. Calculated range [-32768, 32767]. Constant range [-32768, 32767] [unsigned short int] size is 2 bytes. Calculated range [0, 65535]. Constant range [0, 65535] [int] size is 4 bytes. Calculated range [-2147483648, 2147483647]. Constant range [-2147483648, 2147483647] (unsigned int] size is 4 bytes. Calculated range [0, 4294967295]. Constant range [0, 4294967295]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!