Simple interest is money you can earn by initially investing some money (the principal). A percentage (the interest) of the principal is added to the principal, making your initial investment grow!
This simple interest calculator calculates an accrued amount that includes principal plus interest.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
int P, T; float R, SI; Console.Write("Enter Amount :"); P = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter Rate :"); R = Convert.ToSingle(Console.ReadLine()); Console.Write("Enter Time :"); T = Convert.ToInt32(Console.ReadLine()); SI = P * R * T / 100; Console.WriteLine("Interest is :{0}", SI); Console.ReadKey(); Console.ReadLine(); |
Output: