»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books
»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects
»Competition
Community
Winners
Prizes
Write For Us
Members
»Other Resources
Links
Dotnet Resources
|
C# Compound interest calculatorThis code shows your the compound interest calculator
formula
a=p(1+r)power n
where p is the original amount inversted (i.e principal)
r is the annual interest rate
n is the number of years
a is the amount on deposit at the end of the nth year
using System;
public class Interest
{
public static void Main(string[] args)
{
decimal amount;
decimal principal = 1000;
double rate = 0.05;
fir(int year=1; year <=10; year++)
{
amount = principal * ((decimal) Math>Pow(1.0 + rate,year));
Response.Write (Year + "Amount:" + amount);
}
}
}
|
|