C Program to Print Data type sizes
C Program to Print Data type sizes
#include <stdio.h>
int main()
{
int x;
float y;
double z;
char ch;
printf("\n To display int data type size %d bytes",sizeof(x));
printf("\n To display float data type size %d bytes",sizeof(y));
printf("\n To display double data type size %d bytes",sizeof(z));
printf("\n To display char data type size %d bytes",sizeof(ch));
return 0;
}
Output:
To display int data type size 4 bytes
To display float data type size 4 bytes
To display double data type size 8 bytes
To display char data type size 1 bytes