There are simple edits that you can do to fix your code.
int coin count = 0; has a serious error in it. A variable name must be one word. There is nothing connecting
count, so many of the errors stem from this. A simple
count will fix this error.
There are parantheses around your equations, and this is messing up your code. The terminal thinks that there is supposed to be an equation before/after the parentheses, and when it doesn't see any other equation or parentheses, it throws an error. Simply removing the parentheses will fix this error.
You do not have a
; after your
printf at the end of your code. This is a simple edit.
Finally, your if statements have a serious error. In
greedy, you want to use the biggest coins first. Let's walk through what happens in your code.
change, after rounding, is $1. Logically, we know the answer should be 4 coins (4 quarters), but your code outputs something different. Since 1 is less than 4, it enters the
while loop. It hits your first if statement - and since 1 is greater than 0.25, a quarter is extracted. A quarter is the next biggest coin, and should be extracted, but your code moves on to the next if statement. It extracts a dime, a nickel, a penny, and the loop continues.
Obviously, something is very wrong here. Instead of your code hitting the biggest if statement and then looping again, your code hits all the loops. Look very closely at your if statements. Once you realize the mistake, it's a very simple edit.