Program to calculate some of 3 integers

Calculate the sum of 3 integers, until the last number is sum
of previous two numbers. Validate the input provided by user.
Can be further extended for multiple numbers.