Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- double savings = 0;
- double total = 0;
- double interest = 0.05;
- cout<<"Enter a monthly saving amount : ";
- cin>> savings;
- for (int i = 0; i < 6; i++){
- total = (savings+total) * (1+interest / 12);
- }
- cout<<"The account value after the sixth month is $"<<total<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement