/* Determines ranges of char, short, int, and long variables, both * signed and unsigned. Determines ranges of various floating-point * types. */ #include #include #include int main(void) { printf("Signed types:\n"); printf("char: %d - %d\n", SCHAR_MIN, SCHAR_MAX); printf("short: %d - %hd\n", SHRT_MIN, SHRT_MAX); printf("int: %d - %d\n", INT_MIN, INT_MAX); printf("long: %d - %ld\n", LONG_MIN, LONG_MAX); printf("\nUnsigned types:\n"); printf("char: %d - %d\n", 0, UCHAR_MAX); printf("short: %d - %hd\n", 0, USHRT_MAX); printf("int: %d - %u\n", 0, UINT_MAX); printf("long: %d - %lu\n", 0, ULONG_MAX); printf("\nFloats:\n"); printf("float: %g - %g\n", FLT_MIN, FLT_MAX); printf("double: %g - %g\n", DBL_MIN, DBL_MAX); printf("long double: %lg - %lg\n", LDBL_MIN, LDBL_MAX); return 0; }