This program takes in the prinicipal, rate and time as a screen input from the user.
The program is executed (run) 5 times using the 'FOR' loop.
It calculates the simple interest using the formula I = PTR/100.
The principal, rate, time and the simple interest are then outputted using the 'cout' command.
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int i;
float fsinterest,fprincipal,frate,ftime;
for(i=4;i>=0;i--)
{
cout << "Enter the principal, rate & time : " << endl;
cin>>fprincipal>>frate>>ftime;
fsinterest=(fprincipal*frate*ftime)/100;
cout << "Principal = $" << fprincipal << endl;
cout << "Rate = " << frate << "%" << endl;
cout << "Time = " << ftime << " years" << endl;
cout << "Simple Interest = $" << fsinterest << endl;
}
getch();
}
guess wat, during test ppl didnt knew what PTR is :|
ReplyDelete:) great!!! n u told them?? :P
ReplyDelete