0

can show about how to write c programming about loan amount amortization table?

I think this code can for... loop or do... while.... loop

4th Mar 2022, 3:51 PM
lr oi
1 Answer
0
#include<stdio.h> #include<math.h> int main() { double LA,YIR,MP,rate,monthly,interest,principal,balance,loan; int year; int b,p,i; printf("\t\t\tLoan Repayment Table\t\t\t\n\n"); printf("Loan amount:\t"); scanf("%lf",&LA); printf("Yearly interest rate:\t"); scanf("%lf",&YIR); printf("Number of years:\t"); scanf("%d",&year); printf("\nMonthly payment:%.2f\t\t",LA*YIR/12/100*(pow(1+YIR/12/100,year*12)/(pow(1+YIR/12/100,year*12)-1))); scanf("%.2f",&MP); printf("\n\n"); printf(" Beginning Balance \tPayment \tInterest \tPrincipal \tEnding Balance\n"); printf("-------------------\t--------\t---------\t----------\t--------------\n"); for (b=1;b>=LA;b++){ printf("%d\n",b); } return 0; }
5th Mar 2022, 12:16 PM
lr oi