The for loop is properly initialized with i = 1, but the relational test in expression #2 should be
for (i = 1; i <= year, i++)
The reason for i being initialized to 1 instead of the (normal) 0 value is because we need to calculate interest for the first year and a value of 0 produces no interest value.
Sorry for the hiccup.
Dr. Purdum
|