Ranges of unsigned integers
123456789101112131415161718192021222324252627282930313233
# include <stdlib.h>
# include <stdio.h>
# include <limits.h>
int main()
{
unsigned short ushort_max = USHRT_MAX;
printf("Maximum value of unsigned short: %hu \n", ushort_max);
printf("Printing the size of unsigned short: %lu \n", sizeof(ushort_max));
printf("\n-----------------------------\n\n");
unsigned int uint_max = UINT_MAX;
printf("Maximum value of unsigned int: %u \n", uint_max);
printf("Printing the size of int: %lu \n", sizeof(uint_max));
printf("\n-----------------------------\n\n");
unsigned long ulong_max = ULONG_MAX;
printf("Maximum value of unsigned long: %lu \n", ulong_max);
printf("Printing the size of unsigned long: %lu \n", sizeof(ulong_max));
printf("\n-----------------------------\n\n");
return EXIT_SUCCESS;
}
C
INFO