Sunday 20 October 2013

Use of sizeof() in C

#include<stdio.h>
#include<conio.h>
void main()

int a;
float b;
double c;
char d; 
printf("Size of int: %d bytes\n",sizeof(a));
printf("Size of float: %d bytes\n",sizeof(b));
        printf("Size of double: %d bytes\n",sizeof(c));
        printf("Size of char: %d byte\n",sizeof(d)); 
     }


OUTPUT:-

Size of int: 4 bytes 
Size of float: 4 bytes 
Size of double: 8 bytes 
Size of char: 1 byte

No comments :

Post a Comment