Skip to content

Help I just started c programming I am an absolute noob #21487

Answered by airtower-luna
gjon3s asked this question in General
Discussion options

You must be logged in to vote

The problem is that you have a semicolon after for (...). That way the semicolon (empty instruction) becomes the loop body, and the printf() call is executed after the loop terminates. f = 320 is the first value of f for which f <= 300 fails.

Try to find an editor/IDE that can do autoindenting, when the printf() call is indented to the same level as the for you’ll know something is wrong. 😉

And in the future when posting code, please use a markdown code block (enclosed in ```) instead of screenshots, it’s much easier to read that way.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants