while(p*p<=m)
not able to understand this loop.?
Please explain why (p*p<=m)??
while(p*p<=m)
not able to understand this loop.?
Please explain why (p*p<=m)??
this is because all prime factors for a number m will be less than or equal to sqrt(m).
(or equal to m if m is itself prime).
so p<=sqrt(m) OR p*p<=m are equivalent!
okay ji , thank you for help
Welcome Jatin, Keep coding.