0
How can a program overwrite a value by itself?
Hi I want to make a program which counts how much money will you have if you would despose a certain ammount od them to a bank. The code is something like this so far for (int=0;a<3;a++) { cout << n * 1.12 + n << endl; This code is supposed to take your constant monthly deposit multiply it by the bank interest and then add the constant once again. I end up with 3 same numbers because the code cannot overwrite the ammount of money for the end od each month. in short i don't know how to do the title thi
1 Odpowiedź
0
If you want n to increase with each loop, you need to save the changes you made to n each time.
Loopbody
{
n = n * 1.13f +n;
Cout<<n<<endl;
}