0

1. In a for or while loop, if the condition is breached in the middle of the brackets {}, will the code immediately stop the loop, or wait until it gets to the bottom of the brackets {} ?

2. If a function is called in my code, does the computer wait until the function is finished before continuing with the rest of the code?

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by svilla
0

1. In a for or while loop, if the condition is breached in the middle of the brackets {}, will the code immediately stop the loop, or wait until it gets to the bottom of the brackets {} ?

2. If a function is called in my code, does the computer wait until the function is finished before continuing with the rest of the code?

#1. Wait until it gets to the bottom, it will.

#2. Yes it does.

0

You can perform your own test inside the loop and use the break statement to break out of the loop.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.