Completely Free .NET word API

Resources » Code Snippets » C# Syntax

Program to calculate compound interest and total amount

Updated: Category: C# Syntax
Author: Member Level: SilverPoints: 10

This program is based on do-while loop by using C#, useful for bank.


If the user want to calculate compound interest and total amount
at the end of the period this program is useful.
User will ask to enter the principle amount, rate of interest and period.
After entering the values user will get calculated compound interest
and total amount.
If user wants to continue for another amount, user can!


using System;
using System.Text;

namespace BANK
class Program
static void Main(string[] args)
string a;
Console.WriteLine("...Wel-Come To Recurring Deposite Account...");
uint amt, i, amt1, month;
double interest, result = 0, rate;
Console.WriteLine("Enter the amount");
amt = Convert.ToUInt32(Console.ReadLine());
Console.WriteLine("Enter the rate");
rate = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Enter no. of months");
month = Convert.ToUInt32(Console.ReadLine());
amt1 = amt;
for (i = 0; i < month; i++)
interest = amt * rate / 1200;
result = result + interest;
amt = amt + amt1;


Console.WriteLine("Total Interest is :{0}", result);
Console.WriteLine("Total CAPITAL is :{0}", (amt - amt1));
Console.WriteLine("Total AMOUNT is :{0}", (amt - amt1 + result));
Console.WriteLine("Do you want to continue? [YES / NO]");
a = Console.ReadLine();

while (a != "NO" || a != "no");
catch (Exception e)

Did you like this resource? Share it with your friends and show your love!

Responses to "Program to calculate compound interest and total amount"

Post Comment:

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)

    Type the numbers and letters shown on the left.

    Submit Article     Return to Article Index
    Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India