Calculate Simple Interest in C++

C++ Program to calculate the Simple Interest

Source code :

#include <iostream>

using namespace std;

int main(){
    
    int amount,
        rate,
        time,
        interest;
    
    cout<<"Enter the principal amount : ";
    cin>>amount;
    
    cout<<"\nEnter the rate of Interest : ";
    cin>>rate;
    
    cout<<"\nEnter the period of time : ";
    cin>>time;
    
    interest = ( amount * rate * time ) / 100;
    
    cout<<"\nSimple Interest : "<<interest;
    
    
    return 0;

}

Output :

Enter the principal amount : 1000
Enter the rate of Interest : 2
Enter the period of time : 12
Simple Interest : 240

Algorithm :

  1. Get the Principal Amount, Rate and Time from the user
  2. Calculate Simple Interest using the formula ( amount * rate * time ) / 100
  3. Print the Interest

Output :


                

Comments :