The errorshelp50

#include <cs50.h>
   int f = round((get_float("Change owed: ") * 100)
while (f < 0)
    q = ((f / 25)%)
    d = ((q / 10)%)
    n = ((d / 5)%)
    c = (n%)
    i = f + q + d + c
printf ("%i")

Hmmm... I don't see a main() declaration anywhere.

[Edit] The problem in this question is probably the most fundamental part of learning to write a C program. You need to be able to understand how a C program is structured. In comments that have been deleted, the problem persists.

This is so basic an issue that if you can't resolve it, you really need to start over at week 1 with the lectures and the shorts until you understand how to write a C program, even if it is "Hello World!" Once you resolve it, I hope you'll understand the reason I've responded as I have, or at least by the time you get to pset6.

It's even more important that you can learn to resolve these problems, syntax problems, etc., because otherwise, they are going to plague you over your entire programming career. I could easily tell you the problem, but it's far more important that you can research these kinds of issues and resolve it on your own! My telling you doesn't help you at all.

I'm sorry you didn't like the answer and chose to downvote it, but this is more about giving you one of the primary needed skills to program, not to get a pset finished.

"Give a man a fish and you've fed him for a day. Teach him to fish and you've fed him for a lifetime!"

OTOH, I have asked the CS50 staff to modify help50 to provide a more robust explanation than what was given. It does need improvement.

  • 1
    I tried to change my downvote to an upvote but SE locked my vote. @CliffB I fixed my error as well. Also, as a DCCat, I'd be dead if I didn't learn "how to fish" myself. May 27 '20 at 6:38
  • That's cool. As long as you understand my sentiment. This is a teaching forum, unlike most of SE.
    – Cliff B
    May 27 '20 at 6:59

You must log in to answer this question.

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