Bloomberg interview question

Write a program to validate the numbers in range