#include <stdio.h>
int main()
{
    float netBalance,d1,payment,interest,d2,monthlyInterestRate,averageDailyBalance;
    printf("Enter net Balance: \n");
   scanf("%f",&netBalance);
   
    printf("Enter payment made: \n");
    scanf("%f",&payment);
    printf("Enter number of days in the billing cycle: \n");
    scanf("%f",&d1);
    printf("Enter number of days payment is made before billing cycle: \n");
    scanf("%f",&d2);
   printf("Enter interest per month: \n");
 	scanf("%f",&monthlyInterestRate);
    averageDailyBalance = (netBalance * d1 - payment * d2)/d1;
    interest = averageDailyBalance * monthlyInterestRate;
	printf("Interest is %0.2f",interest);
   
    return 0;
}
                             
Comments