Write a program which input principal, rate and time from user and calculate compound interest.
CI = P(1+R/100)T - P
Source Code
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
float P,R,T,CI;
cout<<"Enter Principal, Rate and Time : ";
cin>>P>>R>>T;
CI=P*pow((1+R/100),T) - P;
cout<<"Compound Interest is : "<<CI;
return 0;
}
Output
Enter Principal, Rate and Time : 4500 6.5 3 Compound Interest is : 935.774