Question: 2) This problem requires you to write a program to find the size of predefined data types in C. Table 2-4 in Chapter 2 of

2) This problem requires you to write a program to find the size of predefined data types in C. Table 2-4 in Chapter 2 of the textbook/slides, shown below, presents a summary of C predefined types. Table 2-4 Type Summary Further, in C language, the sizeof () operator is used to calculate the size of variables, pointers or data types. Write a C program that prints the size (i.e., number of bytes reserved for a variable) of the types shown in the table. The following is a sample program that prints sizeof (int): \begin{tabular}{l} \#include \\ int main() \\ \{ \\ printf("Size of int =% ld", sizeof(int)); \\ return 0; \\ \hline \end{tabular} (Skip the types wchar_t.r \& imaginary for this exercise.) To find the size of a variable of type bool and complex you want to add the preprocessor directives \#include \#include Here is a partial output of the required program: Here are the number of bytes used by different types: Size of bool =1 Size of char =1 Size of short int =2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
