//conversion from user input
change *= 100;
change = roundf(change);
int actualchange = change;
//process
{
while (actualchange >= 25)
actualchange -= 25;
quarter++;
}
{
while (actualchange >= 10)
actualchange -= 10;
dime++;
}
{
while (actualchange >= 5)
actualchange -= 5;
nickel++;
}
{
while (actualchange >= 1)
actualchange -= 1;
penny++;
}
//adding the variables to determine how many coins
int coins = quarter + dime + nickel + penny;
printf("You will get %d coins back!\n", coins);
I think I'm on the right track, but every time I put in a number, the output of coins is always 4. I'm not sure what I'm doing wrong. Any insight would be greatly appreciated.