This commit is contained in:
2025-11-21 03:45:38 +07:00
parent d219cc1a7b
commit 5cbfe19d48
12 changed files with 242 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#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;
}