Untitled
unknown
plain_text
2 years ago
847 B
7
Indexable
using System;
namespace SimpleInterestCalculator
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter the principal amount (p): ");
double principal = Convert.ToDouble(Console.ReadLine());
Console.Write("Enter the interest rate (r): ");
double rate = Convert.ToDouble(Console.ReadLine());
Console.Write("Enter the time period in years (t): ");
double time = Convert.ToDouble(Console.ReadLine());
// Calculate Simple Interest
double simpleInterest = (principal * rate * time) / 100;
// Display the result
Console.WriteLine($"Simple Interest (S.I.): {simpleInterest}");
Console.ReadLine(); // Keep the console window open
}
}
}
Editor is loading...
Leave a Comment