Tuesday, 31 July 2018

S.I. / C.I. / E.M.I.

===========================================================================
                                CODING



#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{
int n,P,R,T;
float SI,CI,EMI;
clrscr();
cout<<"\nQ)Want to Find:-";
cout<<"\n  Simple Interest[1]";
cout<<"\n  Compound Interest[2]";
cout<<"\n  Easy Monthly Instalment[3]";
cout<<"\n\n¯What do you want to find:- ";
cin>>n;
switch(n)
{
case 1:
cout<<"\n Enter Principal amount:- ";
cin>>P;
cout<<"\n Enter Rate of interest:- ";
cin>>R;
cout<<"\n Enter Time period:- ";
cin>>T;
SI=(P*R*T)/100.0;
cout<<"\nThe Simple Interest for "<<P<<"Rs. for "<<T<<" years at rate of interest "<<R<<"%p.a. is "<<SI;
break;
case 2:
cout<<"\n Enter Principal amount:- ";
cin>>P;
cout<<"\n Enter Rate of interest:- ";
cin>>R;
cout<<"\n Enter Time period:- ";
cin>>T;
CI=pow(P*(1+R/100),T);
cout<<"\nThe Compound Interest for "<<P<<"Rs. for "<<T<<" years at rate of interest "<<R<<"%p.a. is "<<CI;
break;
case 3:
cout<<"\n Enter P: ";
cin>>P;
cout<<"\n Enter CI: ";
cin>>CI;
cout<<"\n Enter Time: ";
cin>>T;
EMI=(P+CI)/T;
cout<<"\nThe Easy Monthly Instalment For "<<P<<"Rs. and "<<CI<<" compound interest for Time "<<T<<" years is: "<<EMI;
break;
default: cout<<"Wrong input!!!!";
}
getch();
}



===========================================================================


                                OUTPUT



No comments:

Post a Comment