Wednesday, 15 April 2020

C++ Program - Calculate Simple Interest

Q: Write a program which accept principle, rate and time from user and print the simple interest.

Solution:

#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
 int p,r,t,i;
 cout<<"Enter Principle : ";
 cin>>p;
 cout<<"Enter Rate : ";
 cin>>r;
 cout<<"Enter Time : ";
 cin>>t;
 i=(p*r*t)/100;
 cout<<"Simple interest is : "<<i;
 return 0;
}
  Screenshot:
 

No comments:

Post a Comment