Wednesday, March 28, 2018

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.


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.

SORCE CODE:

#include<iostream>
#include<math.h>
using namespace std;
int main(){
            int si,ci,p,t,r;
            cout<<"eter p,t,r values:"<<"\n";
            cin>>p>>t>>r;
            si=(p*t*r)/100;
            ci=p*(pow((1+r/100),t))-p;
            cout<<"the simple intrest is="<<si<<"\n";
            cout<<"the compound intrest is="<<ci<<"\n";
            if(si>ci)            {
                        cout<<"Bank will get simple intrest";
            }
            else{
                        cout<<"Bank will get compound intrest";
            }
            return 0;
}

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home