C++ Program to find Compound Interest

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

Output

Enter Principle, Rate and Time:
1000
2
4

Compound Interest = 1082.43

Leave a Comment

error: Alert: Content is protected!!