هذا حلي للسؤال :
كود PHP:
#include <stdio.h>
#include <math.h>
int main ()
{
float price, downpayment, annual, total;
float amountborrow, payment;
printf("please enter the purchase price -> ");
scanf("%f", &price);
printf("please enter the down payment -> ");
scanf("%f", &downpayment);
printf("please enter the annual interest -> ");
scanf("%f", &annual);
printf("please enter the total number of payments -> ");
scanf("%f", &total);
annual = annual / 12;
amountborrow = ((downpayment + 500) * total) - 500;
payment = (annual * price)/(1-pow((1+annual),-1 * total));
printf("the amount borrowed : %.2f \n", amountborrow);
printf("the monthly payment : %.2f \n",payment / 12);
return 0;
}
بالتوفيق .