-
Compound Interest
Im trying to compute the amount of interest earned on $1 over different amounts of time. Im using the formula P = C(1 + r/n)nt but my answers seem to fluctuate too much especially the higher the interest rate or the time compounded.
For instance $1 compounded at 12% over 5 years should come out to $1.76. I end up getting $1.82
$1 compounded at 16% * 10 years should be $4.41. I get $4.95
$1 compounded at 22% * 25 years should be $144.00. I get $244.28
$1 compounded at 24% * 30 years should be $635.00 I get $1336.26
Is this the right formula or am i doing this wrong? :confused: :p
-
You are using the forumula incorrectly
you can check this code prints 4.41 if you want:
Code:
#include <math.h>
#include <stdio.h>
#define P 1.0 //principal = $1.00
#define N 10.0 // number of years = 10
#define I .16 // annual interest rate 16% -- ie., 16/100
#define Q 1.0 // number of payments per year
// this prints 4.41
int main(){
double A;
A = P* pow((1+ (I/Q)), N * Q);
printf("total= %f\n",A);
return 0;
}
Amount = $1.00 * ( 1 + (.16/1)) 10*1
-
Ahhh ok. It's compounding on an annual basis.
So i can just use the formula P = C(1 + r)t
or P = C(1 + r/n)nt the way you used it.
$4.41 = $1(1 + .16)10
-
I think what i was doing was compounding
on a daily basis. P = C(1 + r/n)nt $4.95 = $1(1 + .16/365)365 *10 that's why my amounts were substantially higher. :rolleyes: :p