Skip to content

Instantly share code, notes, and snippets.

@NonymousMorlock
Created December 6, 2022 12:45
Show Gist options
  • Save NonymousMorlock/1effdc6b8af4093b1737d91937637204 to your computer and use it in GitHub Desktop.
Save NonymousMorlock/1effdc6b8af4093b1737d91937637204 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double amount = 100000;
double interest = 0.08;
double total = 0;
for (int year = 1; year <= 5; year++)
{
total = amount * (1 + interest);
amount = total;
}
cout << total << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment