Check Prime Number

Learn how to check whether the given number is prime or not through Brute Force Approach.

Check prime number

It is easy to find if some number (say N) is prime or not. You simply need to check if at least one number from numbers lower or equal to sqrt(n) is a divisor of N.

For example, let us have n = 13. We will now iterate from 2 to sqrt(13) = 3 (we are taking integers) and check if there is any number that can divide ...