How to get the range of acceptable value of arithmetic types.
numeric_limits from limits can be used to get the acceptable minimum, maximum numbers of the arithmetic types. #include <iostream> #include <limits> using namespace std ; int main ( ) { // integer range cout << " int : " << ( numeric_limits < int > :: min ( ) ) << " to " << ( numeric_limits < int > :: max ( ) ) << " \n " ; // long range cout << " long : " << ( numeric_limits < long > :: min ( ) ) << " to " << ( numeric_limits < long > :: max ( ) ) << " \n " ; // unsigned long range cout << " unsigned long : " << ( numeric_limits < unsigned long > :: min ( ) ) << " to ...