c program to find the size of a variable

SIZE OF VARIABLE

WAP to find size of any variable
void main()
{
int a;
float b;
double c;
char ch;
long d;
char nm[10];
clrscr();
printf("\nInt size is \t:%d", sizeof (a));
printf("\nFloat size is \t:%d", sizeof (b));
printf("\nDouble size is \t:%d", sizeof (c));
printf("\nChar size is \t:%d", sizeof (ch));
printf("\nLong size is \t:%d", sizeof (d));
printf("\nString size is \t:%d", sizeof (nm));
getch ();
}

No comments:

Post a Comment