K&R Exercises

Exercise 2-1: Ranges of integer types

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.

Print a line for each of signed char, unsigned char, signed short, unsigned short, signed int, unsigned int, signed long and unsigned long, in that order: the type, its minimum, and its maximum, separated by spaces, e.g. signed char -128 127.

Test Cases

· space→ tab↵ newline

Submissions

No submissions yet