using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication11
{
class Program
{
static void Main(string[] args)
{
double balance = 19, interestRate = 2, targetBalance = 45;
int totalYears = 0;
do
{
balance *= interestRate;
++totalYears;
}
while (balance < targetBalance);
Console.WriteLine("In {0} year{1} you'|| have {2}.", totalYears, totalYears == 1 ? "" : "s", balance);
Console.ReadKey();
}
}
}