9 October 2013

calculate simple interest in C#.net



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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            double p, r, si;
            int n;
            Console.Write("Enter Principle Amount : ");
            p = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter Nmuber of years : ");
            n = Convert.ToInt32(Console.ReadLine());
            Console.Write("Enter the rate of interest : ");
            r = Convert.ToDouble(Console.ReadLine());
            si = (p * n * r) / 100;
            Console.WriteLine("Simple Interest : {0}", si);
            Console.ReadLine();
        }
    }
}


Output


No comments:

Post a Comment