Wednesday 30 January 2013

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

Comment