Files
sibsutis/test/max.c
T
2025-11-21 03:45:38 +07:00

29 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <stdio.h>
#include <limits.h>
#include <float.h>
int main(void) {
/* Integer types */
printf("Signed char : %d … %d\n", SCHAR_MIN, SCHAR_MAX);
printf("Unsigned char : 0 … %u\n", UCHAR_MAX);
printf("Signed short : %d … %d\n", SHRT_MIN, SHRT_MAX);
printf("Unsigned short: 0 … %u\n", USHRT_MAX);
printf("Signed int : %d … %d\n", INT_MIN, INT_MAX);
printf("Unsigned int : 0 … %u\n", UINT_MAX);
printf("Signed long : %ld … %ld\n", LONG_MIN, LONG_MAX);
printf("Unsigned long : 0 … %lu\n", ULONG_MAX);
printf("Signed long long : %lld … %lld\n", LLONG_MIN, LLONG_MAX);
printf("Unsigned long long: 0 … %llu\n", ULLONG_MAX);
/* Floatingpoint types */
printf("\nFloat : %e … %e (precision: %d digits)\n",
-FLT_MAX, FLT_MAX, FLT_DIG);
printf("Double : %e … %e (precision: %d digits)\n",
-DBL_MAX, DBL_MAX, DBL_DIG);
printf("Long double : %Le … %Le (precision: %d digits)\n",
-LDBL_MAX, LDBL_MAX, LDBL_DIG);
return 0;
}