![]() ![]() ![]() | limits-ints.c - Et program der tilgår konstanter i limits.h. | Lektion 5 - slide 6 : 24 Program 4 |
#include <stdio.h> #include <limits.h> int main(void) { printf("Min. int: %12i Max. int: %12i\n", INT_MIN, INT_MAX); printf("Min. unsigned int: %12u Max. unsigned int: %12u\n", 0, UINT_MAX); printf("Min. long: %12li Max. long: %12li\n", LONG_MIN, LONG_MAX); printf("Min. unsigned long: %12lu Max. unsigned long: %12lu\n", 0, ULONG_MAX); printf("Min. short: %12hi Max. short: %12hi\n", SHRT_MIN, SHRT_MAX); printf("Min. unsigned short: %12hu Max. short: %12hu\n", 0, USHRT_MAX); return 0; }