Home Uncategorized Write a Program that computes the simple interest and compound interest payable...

# Write a Program that computes the simple interest and compound interest payable on principal amount (in Rs.) of loan borrowed by the customer from a bank for a given period of time (in years) at specific rate of interest. Further determine whether the bank will benefit by charging simple interest or compound interest.

SHARE

## 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