Let's take the Range is from 18 to 80.
So, to validate,
We should check that the age is a positive integer.
Then check it should be greater than or equal to 18 and less than or equal to 80.
The test to check whether it is a number or not can be performed by a simple regular expression like
^[0-9]+$
Or even simpler
^\d+$
Then we can check it with range as
if age>=18 && age <=80 return true
else return false