I don't know what is wrong with my code. It works with a 60 cent input for example, it gives me 3 coins, and I know how many of each because I can "see" the code running by using printf
to print out the values. But if my input is 35 cents it will pass right through the 10 cent part of the code.
The thing is I know the 10 cents part works, because it goes through there if my input is 60 cents, it goes twice by 25 cents, I have 10 cents left so it goes through the 10 cent part of the code and that's it.
Here is the 10 cents part:
if (change >= 0.10)
{
do
{
count++;
change = change - 0.10;
printf("B%d\n", count);
printf("%0.2f\n", change);
}
while (change >= 0.10);
}