Sizes of data types

thareefahamed_s · September 23, 2020 · C
#include <stdio.h>

int main() {
    int a;
    short int b;
    long int c;
    float d;
    double e;
    long double f;
    char g;
    printf("#SIZES OF DATA TYPES IN BYTES#\n");
    printf("-----------------------\n");
    printf("The size of int is %d bytes\n",sizeof(a));
    printf("The size of short int is %d bytes\n",sizeof(b));
    printf("The size of long int is %d bytes\n",sizeof(c));
    printf("The size of float is %d bytes\n",sizeof(d));
    printf("The size of double is %d bytes\n",sizeof(e));
    printf("The size of long double is %d bytes\n",sizeof(f));
    printf("The size of char is %d bytes\n",sizeof(g));
    printf("******************************");
    return 0;
}

Comments

Please sign up or log in to contribute to the discussion.