Lesson 9 of 23

break, continue, Prime സംഖ്യകൾ

9 min 25 XP

break loop ഉടൻ നിർത്തുന്നു; continue നിലവിലെ round-ന്റെ ബാക്കി ഒഴിവാക്കുന്നു. Prime പരിശോധിക്കുമ്പോൾ ഹരണസംഖ്യ കിട്ടിയാലുടൻ break ചെയ്യൂ, √n വരെ പരിശോധിച്ചാൽ മതി.

Example: edit me and press Run

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

Challenge

+25 XP

a, b വായിച്ച് a മുതൽ b വരെ (രണ്ടും ഉൾപ്പെടെ) എത്ര primes ഉണ്ടെന്ന് print ചെയ്യൂ. Input: 10 30 → Output: 6

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