Thursday 3 October 2013

Finding size of int,float,double and char of your system using C

#include<stdio.h>
 main()
 {
 int i;
 float f;
 double d;
 char c;
 printf("Size of int: %d bytes\n",sizeof(i));
 printf("Size of float: %d bytes\n",sizeof(f));
 printf("Size of double: %d bytes\n",sizeof(d));
 printf("Size of char: %d byte\n",sizeof(c));
}

No comments:

Post a Comment