/* Exercise 3.20 Solution */ #include main() { float principal, rate, interest; int term; printf("Enter loan principal (-1 to end): "); scanf("%f", &principal); while (principal != -1.0) { printf("Enter interest rate: "); scanf("%f", &rate); printf("Enter term of the loan in days: "); scanf("%d", &term); interest = principal * rate * term / 365.0; printf("The interest charge is $%.2f\n\n", interest); printf("Enter loan principal (-1 to end): "); scanf("%f", &principal); } return 0; }