0

I am really frustrated with this error. I have been try all day, changing my code here and there but nothing works. Plz help me.. This is the screenshot of CS50 appliance running in Vmware Workstation on my windows based laptop.

0

You need to figure out what your code is doing inside. When debugging a program it is perfectly acceptable to put some extra code in the program to help figure out the problems. You can always take the extra code out before you're finished.

In this case, try inserting a couple of extra printf() statements to display the different values in your code. For instance, if you're counting the number of coins with an int called coins, try putting printf("Coins=%i\n", coins); after any statement that changes the value of coins. Do the same for other values that could be causing problems.

That should get you started on finding the problem. You'll get a lot more out of this assignment if you find the problems this way.

If this answers your question, please click the check mark to accept this and remove the question from the unanswered pool. Let's keep up on forum maintenance. ;-)

  • I have tried what you explained. It seems pretty clean. I displayed value of coins and balance left, and tried will all the inputs including the ones causing errors, its all fine. But still not working with that check50. I checked my round formula too. It is also working good. ;-) That's why I have no idea why the problem might lie. – Abhishek Poonia Aug 18 '15 at 13:31
  • How many of these variables are floats? – Cliff B Aug 19 '15 at 2:08
  • Only the amount(money) entered is of type float and rest all are of type int. i converted the decimal part of the money(type float) into int. Can i paste my code? – Abhishek Poonia Aug 19 '15 at 13:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .