Connect with one of the following accounts


Please wait while we redirect...

Views: 157   

Following program shows you how to calculate interest.
In this program we get investment, interest rate and time from user and calculate interest using following formula
Interest = investment X interestRate X time / 100

#include <iostream>

int main() {
    int investment;
    int interestRate;
    int time;

    std::cout << "Enter investment:";
    std::cin >> investment;

    std::cout << "Enter interest rate:";
    std::cin >> interestRate;

    std::cout << "Enter number of years:";
    std::cin >> time;

    int interest = investment * interestRate * time / 100;

    std::cout << "Interest amount is: " << interest;


Enter investment: 200000
Enter interest rate: 24
Enter number of years: 2
Interest amount is: 96000

On By

Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News