I read Kernighan and Ritchie ("The C programming language. SE."), There is such a task:
“ Exercise 2.1. Write a program to determine the ranges of variable types of char, short, int, and long (both signed and unsigned) by outputting the corresponding values from the header files, as well as using direct calculation. For the second method, let's complicate the task: define also the ranges of real types. ”
Everything is clear with the values from the header files, but how to determine that the value exceeded the range?