Here we have provided two programs that calculate the simple interest when the user provides the principal, rate, and time. So let's write a Program to Calculate Simple Interest. To calculate the simple interest, we have used this formula:
Program to Calculate Simple Interest
SI = (p*r*t) / 100 SI = Simple interest p = principal r = rate t = time in years C++
#include<iostream.h> #include< conio.h> void main() { clrscr(); float SI, p,r,t; cout<<"Enter Principal: "; cin>>p; cout<<"Enter rate: "; cin>>r; cout<<"Enter Time: "; cin>>t; SI = (p*r*t)/100; cout<<"The SI is:"<<SI; getch(); }
Output:
Enter Principal: 30000 Enter rate: 2 Enter Time: 4 The SI is: 2400.0
Python
p= float(input("Enter Principal: ")) r= float(input("Enter rate: ")) t= float(input("Enter Time: ")) SI = (p*r*t)/100 print("The SI is:",SI)
Output
Enter Principal: 30000 Enter rate: 2 Enter Time: 4 The SI is: 2400.0
People are also reading:
- Write a Program to calculate to find the root of the quadratic equation
- Write a Program to check number is Even or Odd
- Write a Program to Convert the temperature from Fahrenheit to Celsius and vice-versa
- Write a Program to check whether the year is a leap year or not
- Write a Program to calculate Compound Interest
- Write a Program to Display Fibonacci Series
- Write a Program to Calculate the Size of Data Types
- Write a Program for Armstrong Number
- Write a Program to Reverse a Number
- WAP to create a loading bar
Leave a Comment on this Post