on 1 comment

C++ Program to Find Simple Interest and Compound Interest

C++ Program to Find Simple Interest and Compound Interest

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    float p,r,t,ci,si;
    cout<<"Enter Principle, Rate and Time : ";
    cin>>p>>r>>t;
    si=(p*r*t)/100;
    ci=p*pow((1+r/100),t);
    cout<<"\nSimple Interest : "<<si;
    cout<<"\nCompound Interest : "<<ci;
    return 0;
}

OUTPUT:

Enter Principle, Rate and Time : 1500
4
6

Simple Interest : 360
Compound Interest : 1897.98


1 comment: