Back To C Basics Index
//program to calculate size of a variable using sizeof operator #include
#include
void main() { int a=10; float pi=3.14; char ch='a'; double d=1.2345; clrscr(); printf("\nsize of an integer variable is %d",sizeof(a)); printf("\nsize of an float variable is %d",sizeof(pi)); printf("\nsize of an char variable is %d",sizeof(ch)); printf("\nsize of an double variable is %d",sizeof(d)); getch(); }