Suppose that ‘P’ dollars are borrowed from a bank, with the
understanding that ‘A’ dollars will be repaid each month until the entire
loan has been repaid. Part of the monthly payment will be interest,
calculated as ‘i' percent of the current unpaid balance. The remainder of
the monthly payment will be applied toward reducing the unpaid
balance.
Write a C program that will determine the following information:
The amount of interest paid each month
The amount of money applied toward the unpaid balance each
month
The cumulative amount of interest that has been paid at the end of
each month
The amount of the loan that is still unpaid at the end of each month
The number of monthly payments required to repay the entire loan
The amount of the last payment(since it will probably be less that 'A') write c programs
Answers
Answer:
- shohag Khan to bol dyna you and I am good with you can see it on the attached document for your help and the dust and dry and crunchy and the dust in the attached document y to the above mentioned subject line u y y y y duty of the attached document y to the attached document was signed to nhi aay u y u have y gar y y y yyyyyy to bol dyna nhi hai yyyyyyyyyy to bol dyna nhi hai na tu gytttttyghhhhh type motion detected on device to
Program:
#include<stdio.h>
#include<conio.h>
int main()
{
float P, A, R, I, Unpaid, CI = 0.0, Amount;
int c = 0;
printf("Enter money borrowed from a bank : ");
scanf("%f" , &P);
printf("Enter amount to be repaid each month : ");
scanf("%f" , &A);
printf("Enter rate of interest per month : ");
scanf("%f" , &R);
while(P != 0)
{
c++;
I = (P * R) / 100.0;
CI = CI + I;
Amount = P + I;
Unpaid = Amount - A;
printf("\nInterest = %f \n" , I);
printf("Amount = %f \n" , Amount);
printf("Balance Paid = %f \n" , A);
printf("Remaining Balance = %f \n" , Unpaid);
P = Unpaid;
if(P < A)
{
I = (P * R) / 100.0;
CI = CI + I;
Amount = P + I;
printf("\nLast Payment = %f \n\n" , Amount);
P = 0;
}
}
printf("Cumulative amount of interest = %f \n\n" , CI);
printf("Number of monthly payments : %d \n" , c+1);
return 0;
}