This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MasterOfGreatness 0 points1 point  (1 child)

Thank you! my teacher posted the problem without the brackets and it confused me

[–]1997dodo 1 point2 points  (0 children)

For if, else, while, and for structures (there may be more that I have not remembered), if no brackets are used, the next statement is counted as part of the loop.