Lesson 9 of 23
break, continue and Prime Numbers
9 min 25 XP
break stops a loop immediately; continue skips the rest of the current round. When testing for a prime, break as soon as you find a divisor, and you only need to check up to √n.
Example: edit me and press Run
Output Loading C (first time takes a few seconds)
Press Run to see the result here.