Menu

Tuesday, 23 June 2015

C PROGRAM TO FIND THE SIZE OF INTEGER, FLOAT, DOUBLE AND CHARACTER.



#include<stdio.h>
int main()
{
    int a;  
    long int la;             
    long long int lla; 
    float b;
    double c;
    char d;
    printf("The size of FLOAT is = %d bytes\n",sizeof(b));
    printf("The size of DOUBLE is = %d bytes\n",sizeof(c));   
    printf("The size of CHAR is = %d byte\n",sizeof(d));      
    printf("Size of LONG INT = %ld bytes\n",sizeof(la));
    printf("Size of LONG LONG INT = %ld bytes",sizeof(lla));
    return 0;
}
OUTPUT
The size of INT is = 4 bytes
The size of FLOAT is = 4 bytes
The size of DOUBLE is = 8 bytes
The size of CHAR is = 1 bytes
The size of LONG INT is = 4 bytes
The size of LONG LONG INT is = 8 bytes