Bloomberg Interview Question

Write a program to validate the numbers in range