Write a C# program to calculate how many months it will take to pay off this loan, by having the user input the loan amount, the annual interest rate, and the monthly payment.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
int mo = 0, intre = 0, bmo, pmon, intt, tmont = 0;
Console.WriteLine("Enter The Money Borrowed");
bmo = Int32.Parse(Console.ReadLine());
Console.WriteLine("Enter Monthly payment");
pmon = Int32.Parse(Console.ReadLine());
Console.WriteLine("Enter Annual intrest Rate percentage");
intt = Int32.Parse(Console.ReadLine());


intre = (bmo * intt / 1200);
for (int i = 1; i <= 100; i++)
{
bmo = intre + bmo;
tmont = tmont + pmon;
if (tmont>= bmo)
{
mo = i;
break;
}

}
Console.WriteLine("Months to pay loan will be=" + mo);


Console.ReadKey();

}


}
}


www.ittaleem.com