Lesson 12 of 34

break, continue

7 min 25 XP

break loop ഉടനെ നിർത്തുന്നു. continue ഈ round-ന്റെ ബാക്കി ഒഴിവാക്കി അടുത്ത round-ലേക്ക് പോകുന്നു.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

ഒരു സംഖ്യ prime ആണോ എന്ന് പരിശോധിക്കാൻ 2 മുതൽ മുകളിലേക്ക് ഹരിച്ചുനോക്കൂ, ഹരണസംഖ്യ കിട്ടിയാലുടൻ break ചെയ്യൂ.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Challenge

+25 XP

ഒരു സംഖ്യ n വായിക്കൂ. Prime ആണെങ്കിൽ "Prime", അല്ലെങ്കിൽ "Not prime" print ചെയ്യൂ. (1 prime അല്ല.)

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.