Posts by Jonathan Freitas • 1 point
1 post
-
0
votes2
answers1608
viewsA: Infinite loop trying to calculate if the number is prime
To check whether a number is prime or not, you don’t need to do all the checks from 2 to n. Because the number 2 is the only even prime number, so to check whether 11 is prime or not, you only need…