| types/limits-ints.c - Et program der tilgår konstanter i limits.h. | Lektion 8 - slide 7 : 29 Program 5 |
#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;
}