fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. int main(){
  6. int iTime;
  7. double dRate, dPrinciple, dTotal;
  8.  
  9. cout << "How much money would you like to invest: ";
  10. cin >> dPrinciple;
  11.  
  12. cout <<"\nWhat is the rate of interest: ";
  13. cin >>dRate;
  14.  
  15. cout <<"\nHow long will you be investing the money (in years): ";
  16. cin >> iTime;
  17.  
  18. dRate /=100;
  19.  
  20. dTotal = dPrinciple*pow((1+dRate),iTime);
  21. cout << dTotal;
  22.  
  23. return 0;
  24. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty