Lesson 12 of 34
break மற்றும் continuebreak and continue
7 min 25 XP
break loop-ஐ உடனே நிறுத்தும். continue அந்தச் சுற்றின் மீதியைத் தவிர்த்து அடுத்த சுற்றுக்குச் செல்லும்.
break stops the loop immediately. continue skips the rest of this round and moves on to the next one.
Example: edit me and press Run
Press Run to see the result here.ஒரு எண் prime-ஆ என்று சோதிக்க: 2 முதல் வகுத்துப் பாருங்கள்; ஒரு வகுத்தி கிடைத்தவுடன் break.
To test whether a number is prime, try dividing from 2 upwards and break as soon as you find a divisor.
Example: edit me and press Run
Press Run to see the result here.