Computer Science, asked by kritish89, 4 months ago

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 anindyaadhikari13
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:

  1. START.
  2. Accept the principal, rate and time period.
  3. Calculate simple interest.
  4. Display the result.
  5. STOP.

See the attachment for output ☑.

Attachments:
Similar questions