Write a C++ program which accept principle, rate and time from user and print the simple interest.

Program Code:
#include<iostream>
using namespace std;
int main()
{
int principle,rate,time,interest;
cout<<" Enter Principle : ";

cin>>principle;
cout<<endl;
cout<<" Enter Rate : ";
cin>>rate;
cout<<endl;
cout<<" Enter Time : ";
cin>>time;
cout<<endl;
interest = (principle * rate * time)/100;
cout<<" Simple interest is : "<< interest;
return 0;
}

The program code is tested on www.jdoodle.com
Output:
Enter Principle : 1000
Enter Rate : 2
Enter Time : 4

Simple interest is : 80


Thanks
Mukesh Rajput


Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: