Lesson 9 of 23

break, continue மற்றும் Prime எண்கள்

9 min 25 XP

break loop-ஐ உடனே நிறுத்தும். continue அந்தச் சுற்றைத் தவிர்க்கும். 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 வரை (இரண்டும் சேர்த்து) உள்ள prime எண்களின் எண்ணிக்கையை print செய்யுங்கள். Input: 10 30 → Output: 6

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