Write a C++ program to input the principal amount (p), rate of interest(r) and time in years (t). calculate and display the simple interest S as PRT/100
Answers
Answered by
3
Required Answer:-
Question:
- Write a C++ program to calculate simple interest.
Solution:
Here comes the solution.
#include <iostream>
using namespace std;
void main() {
double p,r,t,si;
cout << "Enter Principal: ";
cin >> p;
cout << "Enter Rate: ";
cin >> r;
cout << "Enter Time: ";
cin >> t;
si=p*r*t/100.0;
cout << "Simple Interest: " << si;
}
Algorithm:
- START.
- Accept the principal, rate and time period.
- Calculate simple interest.
- Display the result.
- STOP.
See the attachment for output ☑.
Attachments:
Similar questions