Note: %zu format specifier is used to print the result of the sizeof operator, which gives the size of a data type in bytes. (alert-passed)
C program to find the size of different data types.
//C program to find size of data types #include <stdio.h> int main() { int intSize; float floatSize; char charSize; double doubleSize; // size of each data type printf("Size of int data type: %zu \n", sizeof(intSize)); printf("Size of float data type: %zu \n", sizeof(floatSize)); printf("Size of char data type: %zu \n", sizeof(charSize)); printf("Size of double data type: %zu \n", sizeof(doubleSize)); return 0; }
Size of int data type: 4
Size of float data type: 4
Size of char data type: 1
Size of double data type: 8





