im getting the error for 41 cents. The answer I get when i run the program is three coins i cannot figure out why. Can someone let me know if i did something wrong here?
#include <stdio.h>
#include <cs50.h>
#include <math.h>
#define QUARTER 25;
#define DIME 10;
#define NICKEL 5;
int main(void)
{
float change= 0;
int cent_amount=0;
int quarter_amount=0;
int dime_amount=0;
int nickel_amount=0;
int leftover_amount=0;
int coin_amount=0;
do {
printf("How much change needed? ");
change = GetFloat();
if (change == 0 || change <= 0)
printf ("Number should be greater than 0!\n");
}
while (change < 0);
cent_amount= (int)(change*100);
quarter_amount= cent_amount / QUARTER;
leftover_amount= cent_amount % QUARTER;
dime_amount= leftover_amount/ DIME;
leftover_amount= cent_amount % DIME;
nickel_amount= leftover_amount/ NICKEL;
leftover_amount= cent_amount % NICKEL;
coin_amount= quarter_amount + dime_amount + nickel_amount + leftover_amount;
printf ("%d\n",coin_amount);
return 0;
}