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.