DEV Community

Discussion on: Number Theory: Primality Test in O(sqrt(n))

Collapse
 
starlordadi06 profile image
Starlord (Aditya Singh)

i*i<=n.........

kindy correct.........
your code not working for 9.

Collapse
 
mohithgupta profile image
K.Mohith Gupta

it should be i*i<=n
(I know it's late, but....I had to)