Question: You need to write a for loop in C++ to calculate compounded monthly interest.
So for example if I were to have an initial balance of $1250.00 with an interest rate of %13 paid over the course of 4 months it should come out to $2038.09 total for interest added to the initial balance. So the interest by itself should be $788.09.
My loop keeps giving me 2096.66.
I am not sure what the correct formula is but I know it's something like
A=P*(1+r/12)^12*n
My loop is so close to giving me the correct answer.
Could someone please help me build this C++ loop for compounded monthly interest? Thank you
Can somebody provide the answer for given question with example?