C# Program To Calculate the Simple Interest

write a program in C# to find the simple interest, the user will input principal, the rate of interest and time of duration.C# Program To Calculate the Simple Interest.

logic:-

  1. use formula si=/(p*r*t)/100

where p = principal amount

r= rate of interest

t=time of duration

2. allow user to give input as principal, the rate of interest and time of duration and store in a variable p,r, and t

3. use formula to calculate SI

4. print output

C# Program To Calculate the Simple Interest

using System;
namespace SimpleInterest
{
    class Program
    {
        static void Main(string[] args)
        {
            int p, t;
            float r, SI;
            Console.Write("Enter Principle :");
            p = Convert.ToInt32(Console.ReadLine());
            Console.Write("Enter Rate of interest :");
            r = Convert.ToSingle(Console.ReadLine());
            Console.Write("Enter Duration of time :");
            t= Convert.ToInt32(Console.ReadLine());
            SI = p * r * t / 100;
            Console.WriteLine("Simple Interest is :{0}", SI);
            Console.ReadKey();
        }
    }
}

output:-

example1-
Enter principle- 8000
Enter rate- 5
Enter year-2

simple interest is:-800

example2-
Enter principle- 500
Enter rate- 5
Enter year-2

simple interest is:-50

example 3-

Enter principle- 100
Enter rate- 7
Enter year-3

simple interest is:-21
C# Program To Calculate the Simple Interest
output:

 

you may also like….

 


C program to calculate simple interest using function

cpp program to calculate simple interest using function c++

java program to calculate simple interest using function

Python Program to Calculate Simple Interest using function


 

One Reply to “C# Program To Calculate the Simple Interest”

Leave a Reply

Your email address will not be published. Required fields are marked *