Program to shows Size of different data types in C | Printing Size of Data types in C

Program to shows Size of different data types in C | Printing Size of Data types in C


#include
#include
int main()
{
 int i;
 char ch;
 float f;
 long l;
 double d; 
 long double ld;
 printf("\n\tSize of different data types as following");
 printf("\n");
 printf("\nSize of character ch is %d",sizeof(ch));
 printf("\nSize of integer is %d",sizeof(i)); 
 printf("\nSize of float is %d",sizeof(f));
 printf("\nSize of long is %d",sizeof(l));
 printf("\nSize of double is %d",sizeof(d));
 printf("\nSize of long double is %d",sizeof(ld));
 getch();
 return 0;
}



No comments:

Post a Comment