Showing posts with label Sample code in to find the size of variable in C. Show all posts
Showing posts with label Sample code in to find the size of variable in C. Show all posts

Thursday, May 3, 2012

WAP TO FIND SIZE OF ANY VARIABLE



#include<stdio.h>
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 ();


}


Output of this Program is:
Dont forget to give any Suggestion or Comments