Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+9 votes
asked ago in CSC211_Winter2018 by (515 points)

2 Answers

+4 votes
 
Best answer

Technically, yes, there is a way. Depending on what you are asking, either the continue or break commands might be what you are thinking of.

HOWEVER, using these commands inside of FOR loop is almost always a sign of poor coding style. Why can't you just have the FOR loop go fewer cycles instead, by changing the condition (i.e. i <= 5 instead of i <= 7)?

answered ago by (4.5k points)
selected ago by
–1 vote

Are you talking about infinite loops?

answered ago by (2.6k points)
0

No, I'm just wondering if there's a way that a normal for-loop can be cut off at a certain point.

...