Original Post
Hello everyone! I just wanted to know did I solve the problem giving to me in K&R "The C Programming Language": Please and Thank you! Julio A. Cruz
/*
Write a program to determine the ranges of char, short, int,
and long variables, both signed and unsigned, by printing
appropriate values from standard headers and by direct computation.
Harder if you compute them: determine the ranges of the various
floating-point types.
*/
#include <stdio.h>
#include <limits.h>
#include <float.h>
main()
{
printf("Bits in a char: %d\n", CHAR_BIT);
printf("Maximum value of char: %d\n", CHAR_MAX);
printf("Minimum value of char: %d\n", CHAR_MIN);
printf("Maximum value of int: %d\n", INT_MAX);
printf("Minimum value of int: %d\n", INT_MIN);
printf("Maximum value of long: %d\n", LONG_MAX);
printf("Minimum value of long: %d\n", LONG_MIN);
printf("Maximum value of short: %d\n", SHRT_MAX);
printf("Minimum value of short: %d\n", SHRT_MIN);
printf("Maximum value of signed char: %d\n", SCHAR_MAX);
printf("Minimum value of signed char: %d\n", SCHAR_MIN);
printf("Maximum value of unsigned int: %d\n", UINT_MAX);
printf("Maximum value of unsigned long: %d\n", ULONG_MAX);
printf("Maximum value of unsigned short: %d\n", USHRT_MAX);
return 0;
}