All Available Datatypes in C | Size of all Datatypes in C

Spread the love

/********** Program **********/

#include<stdio.h>
#include<limits.h>
#include<float.h>
int main(void)
{
printf(“sizeof(char) = %un”,sizeof(char));
printf(“sizeof(short) = %un”,sizeof(short));
printf(“sizeof(int) = %un”,sizeof(int));
printf(“sizeof(long) = %un”,sizeof(long));
printf(“sizeof(float) = %un”,sizeof(float));
printf(“sizeof(double) = %un”,sizeof(double));
printf(“sizeof(long double) = %un”,sizeof(long double));

printf(“SCHAR_MIN = %dn”,SCHAR_MIN);
printf(“SCHAR_MAX = %dn”,SCHAR_MAX);
printf(“UCHAR_MAX = %dn”,UCHAR_MAX);

printf(“SHRT_MIN = %dn”,SHRT_MIN);
printf(“SHRT_MAX = %dn”,SHRT_MAX);
printf(“USHRT_MAX = %un”,USHRT_MAX);

printf(“INT_MIN = %dn”,INT_MIN);
printf(“INT_MAX = %dn”,INT_MAX);
printf(“UINT_MAX = %un”,UINT_MAX);

printf(“LONG_MIN = %ldn”,LONG_MIN);
 printf(“LONG_MAX = %ldn”,LONG_MAX);
 printf(“ULONG_MAX = %lun”,ULONG_MAX);
    
printf(“FLT_MIN = %en”,FLT_MIN);
printf(“FLT_MAX = %en”,FLT_MAX);

printf(“DBL_MIN = %en”,DBL_MIN);
printf(“DBL_MAX = %en”,DBL_MAX);

printf(“LDBL_MIN = %en”,LDBL_MIN);
printf(“LDBL_MAX = %en”,LDBL_MAX);

/*Number of digits of precision*/
printf(“FLT_DIG = %dn”,FLT_DIG);
printf(“DBL_DIG = %dn”,DBL_DIG);
printf(“LDBL_DIG = %dn”,LDBL_DIG);
return 0;
}

/*********** OUTPUT ***************/


Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply