Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 2

#include<stdio.

h>
#include<conio.h>

main()
{
printf("\nSHORT TERM LOAN CALCULATOR\n");
float a, b, c;
printf("\nEnter the entire loanable amount:Php ");
scanf("%f",&a);
printf("\nEnter the initial downpayment:Php ");
scanf("%f",&b);
c=a-b;
printf("\nRemaining balance = Php %.2f\n",c);
int m;
float i, r;
printf("\nEnter the interest rate per month: ");
scanf("%f",&i);
while (i<0)
{
printf("\nInvalid Interest Rate\n");
printf("\nEnter the interest rate per month: ");
scanf("%f",&i);
}
if (i==0)
printf("\nNo Interest Rate\n");
printf("\nEnter the no. of months to pay remaining balance: ");
scanf("%d",&m);
r=(c/m)+((a*(i/100))*m);
printf("\nMonthly payment for %d months = Php %.2f\n",m, r);
printf("\n\nTHANK YOU!\n");
return 0;
}
RUNNING PROGRAM

You might also like