Dremendo Tag Line

Calculate simple interest in C++

cin - Question 14

In this question, we will see how to input principal, rate, time in C++ programming using the cin statement and find the simple interest. To know more about cin statement click on the cin statement lesson.

Q14) Write a program in C++ to input principal, rate, time and find the simple interest.

Formula: Simple Interest = (Principal * Rate * Time) / 100

Program

#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
    int p,r,t,si;
    cout<<"Enter principal ";
    cin>>p;
    cout<<"Enter rate ";
    cin>>r;
    cout<<"Enter time ";
    cin>>t;
    si=(p*r*t)/100;
    cout<<"Simple Interest="<<si;
    return 0;
}

Output

Enter principal 5000
Enter rate 10
Enter time 1
Simple Interest=500
video-poster