#include <stdio.h>
int main()
{
float Principal; //資金
float Rate; //利率
int Days; //天數
float Interest; //利息
printf("Enter loan principal (-1 to end):");
scanf("%f", &Principal);
while(Principal !=-1){
printf("Enter interest rate: ");
scanf("%f",&Rate);
printf("Enter term of the loan in days: ");
scanf("%d",&Days);
Interest= Principal* Rate *(float)Days /365;
printf("The interest charge is $%.2f\n\n",Interest);
printf("Enter account number (-1 to end):");
scanf("%f", &Principal);
}
system("pause");
return 0;
}