#include <iostream.h>
#include <conio.h>
#include<math.h>
void main()
{
double p, r, t, i, am;
cout<< " Enter principal, rate , time ?";
cin>> p >> r >> t;
// Calculate Simple interest
i = (p * r* t) / 100;
am = p + i;
cout<< "\n Principal Amt = Rs. " << p;
cout<< "\n Rate = " << r << "%" ;
cout << "\n Time = " << t << "yrs.";
cout<< "\n The Interest Amt = Rs. " << i ;
cout<< "\n The Total Amt = Rs. " << am;
// Calculate Compound interest
am = pow((p* ( 1 + (r/100)), t);
i = am - p;
cout << "\n The Interest Amt = Rs. " << i;
cout<< "\n The Total Amt = Rs. " << am;
getch();
}
#include
void main()
{
double p, r, t, i, am;
cout<< " Enter principal, rate , time ?";
cin>> p >> r >> t;
// Calculate Simple interest
i = (p * r* t) / 100;
am = p + i;
cout<< "\n Principal Amt = Rs. " << p;
cout<< "\n Rate = " << r << "%" ;
cout << "\n Time = " << t << "yrs.";
cout<< "\n The Interest Amt = Rs. " << i ;
cout<< "\n The Total Amt = Rs. " << am;
// Calculate Compound interest
am = pow((p* ( 1 + (r/100)), t);
i = am - p;
cout << "\n The Interest Amt = Rs. " << i;
cout<< "\n The Total Amt = Rs. " << am;
getch();
}
gud 1
ReplyDeletecan u do this by using functions
plz reply
gud...
ReplyDelete