public static void Main(string[] args)
Console.Write("The amount you want to have at the end: ");
while (!int.TryParse(Console.ReadLine(), out targetAmount));
Console.Write("Your age at the end: ");
while (!byte.TryParse(Console.ReadLine(), out targetAge));
Console.Write("Your age at the beginning: ");
while (!byte.TryParse(Console.ReadLine(), out startAge));
Console.WriteLine("\nCalculation (5% p.a.):\n");
PrintOverview(targetAge, startAge, targetAmount, 5);
static void PrintOverview(byte targetAge, byte startAge, int amount, int interestRate)
for (; targetAge >= startAge; targetAge--)
Console.WriteLine("At {0} you have to have {1} on your account", targetAge, amount);
amount = (int)(amount / (1 + (double)interestRate / 100));