I can't seem to get the arithmetic in my greedy pset solution working. Please can someone point me in the right direction. Here is a screen shot of my code, and some of the errors showing up. Thanks!
Code:
change = round(change * 100);
int quarter = 25;
int dime = 10;
int nickle = 5;
int penny = 1;
int coin count = 0;
while (change > 0)
{
if (change - quarter >= 0)
{
(change = change - quarter);
(coin count = coin count + 1);
}
if (change - dime >= 0)
{
(change = change - dime);
(coin count = coin count + 1);
}
if (change - nickle >= 0)
{
(change = change - nickle);
(coin count = coin count + 1);
}
if (change - penny >= 0)
{
(change = change - penny);
(coin count = coin count + 1);
}
}
printf("%i", coin count)