C program that will calculate the interest paid on a loan
C program that will calculate the interest paid on a loan
HW-1
Create a C program that will calculate the interest paid on a loan. The equations we will use are:
I[o] = (r/12)*B I[n] = (r/12)*(B-P+I[n-1])
Where: r is the annual interest rate (assume 25% or 0.25). B is the amount borrowed (assume $2000). P is the payment amount (pick some value). I[o] is the interest due after the first month. I[n] is the interest due after the nth month.
Your program must prompt the user for the monthly payment that they wish to make. Your program must then display the interest rate (r), the initial balance (B), the monthly payment (P). Your program must then produce a month-by-month table showing the month, the interest due/paid each month and the remaining balance.
The table must take the user to the payoff-point (where balance becomes zero or negative). Finally the program must display the total interest paid over the life of the loan.