#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf(“TypettttSize (bytes)”);
printf(“nCharacterttt %d”,sizeof(char));
printf(“nIntegertttt %d”,sizeof(int));
printf(“nLong intttt %d”,sizeof(long int));
printf(“nFloattttt %d”,sizeof(float));
printf(“nDoubletttt %d”,sizeof(double));
printf(“nLong doublettt %d”,sizeof(long double));
getch();
}
why %d for char, double, float ?
Actually here we are printing the size of data type and size will be an integer value. To print an integer value we use %d, I hope it will clear your confusion.
Actually it print size of datatype so
Size is on integer
write a program to print the size of all the datatypes supported by c and its range