fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. float principal, rate, time, simpleInterest;
  6.  
  7. cout << "Enter Principal amount: ";
  8. cin >> principal;
  9.  
  10. cout << "Enter Rate of Interest: ";
  11. cin >> rate;
  12.  
  13. cout << "Enter Time (in years): ";
  14. cin >> time;
  15.  
  16. simpleInterest = (principal * rate * time) / 100;
  17.  
  18. cout << "Simple Interest = " << simpleInterest;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 5312KB
stdin
1000
5
2
stdout
Enter Principal amount: Enter Rate of Interest: Enter Time (in years): Simple Interest = 100