How do you interrupt a while loop?

Đinh Yến

New member
How do you interrupt a while loop?
Answer
A while loop can also terminate when
a break, goto, or return within the statement body is executed
. Use continue to terminate the current iteration without exiting the while loop. continue passes control to the next iteration of the while loop. The termination condition is evaluated at the top of the loop.
 

Tìm kiếm

Back
Top