How to Check the Number Is Prime or Not?

If the number is less than 2, it is not prime

If the number is 2, it is prime

If the number is even and greater than 2, it is not prime

Check divisibility by integers from 3 up to the square root of the number

If any integer divides it exactly, it is not prime

If no integer divides it exactly, it is prime

Suggested for You

Trending Today