Find simple interest in C++ by R4R Team

Here we try to find the simple interest when we have a principle, rate of interest, and time.
S.I=(principle*rate*time)/100

program:

#include< iostream>
class r4r
{
int p,r,t;
public:
int get_data()
{
cout<<"Enter principle"<< endl;
cin>>p;
cout<<"Enter rate"<< endl;
cin>>r;
cout<<"Enter time"<< endl;
cin>>t;
}
int find_SI()
{
float simple_int;
simple_int=(p*r*t)/100;
cout<<"Simple interest is "<< simple_int<< endl;
}
};
int main() {
r4r obj;
obj.get_data();
obj.find_SI();
}


output-

Enter principle
1000
Enter rate
10
Enter time
3
300.000000

-In this program, we take an input of principle, rate of intrest, and time.
-Apply simple intrest formula in input data and display the result.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!