I am doing the cs50 problem set \"Greedy\". Basically asking the user for how much change is owed and then outputting the minimum amount of coins that can equal the inputed amou
Use the round function to round up your numbers. In this part of your code, you need to add the round function.
int cents = (int)(n * 100);
It has to be like this:
cents = round(n * 100);
If you have other such problems, you can use a debugger such as debug50, in which you put a breakpoint by clicking in the right of the line number, then in your terminal window(the one where you execute clang) you should type:
~/pset1/cash/ $ debug50 ./cash
Or whatever your program is called. This will open the debugger and inside it you will find all the variables and what they are equal to. Press on the button next to the play button to move one line of code forward.