AIM: Write a C++ program that computes the simple intrest and compound intrest payable on principal amount of loan borrowed by the customer from bank for a given period of time at specific rate of intrest. Further determine the bank will benefit by charging simple intrest or compound intrest.
#include <math.h>
#include <iostream>
using namespace std;
int main()
{
int P,R,T;
double SI,CI;
cout<<“Enter the principal, time period & interest rate:\n”;
cin>>P>>R>>T;
SI=(P*R*T)/100;
CI=P*(pow(1+(double)R/100,T))-P;
cout<<“The S I is”<<SI<<endl;
cout<<“The C I is”<<CI<<endl;
if(SI<CI)
{
cout<<“Bank is Benefited by COMPOUND INTREST”;
}
else
{
cout<<“Bank is Benefited by SIMPLE INTEREST”;
}
return 0;
}
OUTPUT:
Enter the principal, time period & interest rate:
1000
12
2
The S I is 240
The C I is 254.4
Bank is Benefited by COMPOUND INTEREST