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

0 votes
110 views
Rahul Ahuja asked 09-Sep-2018 in programming by Rahul Ahuja
edited 09-Sep-2018 by Harsh-Srivastava

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

1 Answer

0 votes
Sanat Shukla answered 10-Sep-2018 by Sanat Shukla

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();
        }
    }
}