Friday, 26 July 2013

Write a C++ Program for Calculating Simple Interest

#include<iostream>

using namespace std;

int main()
{
int p;
float r, t, amount, interest;

cout<<"\n\n******Program to Calculate Simple Interest*******\n\n";
 
cout<<"\n              1.Enter the Principal Amount : ";
cin>>p;

cout<<"\n              2.Enter the Time Period : ";
cin>>t;

cout<<"\n              3.Enter the Rate of Interest : ";
cin>>r;

interest = (p*r*t)/100;

amount = p + interest;

cout<<"\n              4.The simple interest is : "<<interest;

cout<<"\n\n           5.The Amount is : "<<amount;

cout<<"\n\n ";

return 0;
}