#include <stdio.h>
#include <conio.h>
int main()
{
float a,b,c,n,m,x,y,z,t,t1;
printf("Enter Price of motorcycle: ");
scanf("%f",&n);
printf("Enter Amount of down payment: ");
scanf("%f",&m);
printf("Enter Period: ");
scanf("%f",&t);
x = n - m;
a = n*20/100;
b = x/12;
t1 = t*12;
y = x*4.3/100*t1;
z = y + n;
c = n + y;
if(m >= a && t == 1 || t == 2 || t == 3 || t == 4){
printf("\n\nCalculate results of installment motorcycle: ");
printf("\n\nPrice of motorcycle = %f Bath",n);
printf("\n\nDown payment = %f Bath",m);
printf("\n\nInterest = %f percent/year",4.3);
printf("\n\nPeriod = %f month",t1);
printf("\n\nHave to pay about = %f Baht/month",b);
printf("\n\nAll interest = %f Bath",y);
printf("\n\nSummary of all payments (car price + interest) is %f",c);
}
getch();
}