answersLogoWhite

0


Best Answer

#include <stdio.h>

#include <math.h>

#define p printf

#define s scanf

int mnthlyPymnt(float loan,float i_yr,int num_yrs );

void table(float loan, float IM, float monthly, int NM);

int main(void)

{

float in_loan,in_yr;

int in_yrs;

p("\nThe amount of the loan (principal): ");

s("%f", &in_loan);

p("\nInterest rate/year (percent)? ");

s("%f",&in_yr);

p("\nNumber of years:\t");

s("%d",&in_yrs);

mnthlyPymnt( in_loan, in_yr, in_yrs );

return 0;

}

int mnthlyPymnt(float loan,float i_yr,int num_yrs )

{

int NM;

float IM, monthly;

float P, Q;

NM = num_yrs * 12;

IM = (i_yr / 12)/100;

P =pow (1 + IM, NM);

Q= (P /(P-1));

monthly = loan * IM * Q;

p("\nThe amount of the loan (principal): %.2f",loan);

p("\nInterest rate/year (percent): %.0f%%", i_yr);

p("\nInterest rate/month (decimal):%f ", IM);

p("\nNumber of years: %d", num_yrs);

p("\nNumber of months: %d",NM);

p("\nMonthly Payment:%.2f ", monthly);

table(loan, IM, monthly, NM);

return monthly;

}

void table(float loan, float i_month, float monthly, int n_month)

{

float int_paid, prin_paid, new_b,total_paid;

int month, x;

p("\n\nMonth OldBalance MonthlyPayment InterestPaid PrincipalPaid NewBalance");

month = n_month;

int_paid = loan * i_month;

prin_paid = monthly - int_paid;

new_b = loan - prin_paid;

total_paid = monthly;

for(x=1;x<=month;x++)

{

p("\n%d\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f\t\t%.2f", x, loan, monthly, int_paid, prin_paid,new_b);

loan = new_b;

total_paid = total_paid + monthly;

int_paid = loan * i_month;

prin_paid = monthly - int_paid;

new_b = loan - prin_paid;

}

total_paid = total_paid - 441.93;

p("\n\nTotal amount paid: %.2f", total_paid);

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to write a c program that prints a loan amortization schedule based on user input of principal annual percentage rate of interest and number of years in the loan Interest is calculated monthly?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Finance
Related questions

How is a mortgage amortization table created?

A mortgage amortization table is created by taking the principal and the interest rate percentage, along with the length term of the mortgage. The amortization table is to gain an estimate of what the buyer needs to pay and for how long.


What would you use an amortization table for?

An amortization table is a schedule which breaks down your monthly repayments into principal and interest. You can use it to determine how much principal interest you will pay during your mortgage term.


What is amortization home loans?

An amortization schedule is a table detailing each periodic payment on an amortizing loan (typically a mortgage), as generated by an amortization calculator. Amortization refers to the process of paying off a debt (often from a loan or mortgage) over time through regular payments. A portion of each payment is for interest while the remaining amount is applied towards the principal balance. The percentage of interest versus principal in each payment is determined in an amortization schedule.


How can an amortization chart be produced?

An amortization chart is created from an amortization table or amortization schedule to show visually how the balance, cumulative interest, and principal change over the time.


How is the interest on an auto loan calculated?

Auto loan interest payments are calculated using an amortization schedule.


Which websites offer a mortgage amortization schedule?

This loan amortization calculator shows you the breakdown between principal and interest in your mortgage payments. Each calculation shows you amortization .


What is meant with amortization schedule mortgage?

Breakdown of the amortization in to Interest and Principal is called Amortization schedule. This is useful customers to know how much interest is stuffed in to an amortization. These days EMI is most popular way of amortization, where customer pays same amount throughout amortization period. With Amortization Schedule customer can know how much interest he is paying in every amortization. Find more info at www.investorwords.com/202/amortization_schedule.html


Which of these shows how a loan is paid by listing the principal and interest with each payment?

An amortization table


What is the process for the amortization of a loan?

Amortization of a loan is calculated according to the interest rate you have obtained from your lending institute. When a loan is amortizised over ten years, the principle, or original price of the product, is multiplied by the interest percentage for each year or month, and that is added to the total of the loan.


What do you understand by Loan Amortization?

Loan amortization is the process of paying back a loan over an extended duration of time along with the interest incurred. The interest to be paid for the amount borrowed, till the loan is completely repaid, is calculated in advance. This is divided by the total number of payments being made and added with the principal payments to arrive at an amount that consists of both the principal as well as the interest. The payments have to be made according to this amortization schedule, which is decided before the loan is issued and could be in the form of simple monthly or annual payments. Before the principal amount is issued, the terms for calculation of the interest are also fixed.


What does an amortization table show me?

An amortization table is a report of all pertinent information regarding a loan including the terms of the loan and a list of each calculated loan payment. Each loan payment entry could show:the amount of principal due as of this paymentamount of the paymentportion of payment used as interest (the amount of interest in this payment)portion of payment that reduces the principal for the next payment entry


What is the interest calculated only on the principal?

simple interest