fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double monthly_rent = 0.0;
  6. double annual_rent = 0.0;
  7.  
  8. cout << "Enter the monthly rental cost" << endl;
  9. cin >> monthly_rent;
  10.  
  11. for (int month = 0; month < 12; month++) {
  12. annual_rent += monthly_rent;
  13. }
  14.  
  15. cout << "Your annual rental cost is $" << annual_rent << endl;
  16. return 0;
  17. }
Success #stdin #stdout 0s 3348KB
stdin
Standard input is empty
stdout
Enter the monthly rental cost
Your annual rental cost is $0