Simple interest

Simple interest is a simple way to calculate the interest on a loan. Simple interest is determined by multiplying the principal by the daily interest rate multiplied by the number of days elapsed between payments. – Investopedia

Logic

After taking input (Principle, Rate, Time) from the user we have to use a very simple formula shown below:

Simple interest formula

Where, P = Principle, T = Time and R = Rate

To calculate simple interest we have to multiply principal, rate and time, then divide it by 100 and print the result.

Program

#include <iostream>

using namespace std;

int main() {

    float principal, rate, time, result;

    cout << "Enter principal : ";
    cin >> principal;

    cout << endl << "Enter rate : ";
    cin >> rate;

    cout << endl << "Enter time (year) : ";
    cin >> time;

    // Calculate simple interest
    result = (principal * rate * time) / 100;

    cout << endl << "Simple interest : " << result;

    return 0;
}

Output

Enter principal : 1000
Enter rate : 4
Enter time (year) : 2
Simple interest : 80