I need an algorithm that finds how many prime numbers are in a set interval; the interval maximum range is 1 000 000 so a brute force method of checking every number is kinda inefficient

mikeshadow
0
Newbie Poster

thines01
401

frogboy77
73

rohan121212
-4

frogboy77
commented:
terrible advice and worse code
-1

LRRR
9

zeroliken
commented:
+rep, For clarifying the code above
+6

rohan121212
-4

zeroliken
79

NathanOliver
429

WaltP
2,905

WaltP
commented:
Ahh of course. how stupid of me! ;o)
+17

Lerner
582

jaskij
45

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.