How can write a program in C# for Simple Interest ?

Asked 09-Sep-2018
Updated 09-Sep-2018
Viewed 709 times

1 Answer


0

How can write a program in C# for Simple Interest ?

using System;

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

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
            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(in Year) :");
            T = Convert.ToInt32(Console.ReadLine());
            SI = P * R * T / 100;
            Console.WriteLine("Simple Interest is :{0}", SI);
            Console.ReadKey();
        }
    }
}