A number which is greater than 1 and divisible by 1 or itself is called prime number.
2 is an even prime number because it is evenly divisible by itself and divisible by 1.
All even numbers are not prime numbers. If the last digit of the number contains 0 2 4 6 8 then the number divisible by 2 thus the number is not a prime number.
Ex: First few prime numbers are 2, 3, 5, 7, 11, 13 ..........
Here I am posting a code snippet to find whether a given number is prime number or not.
No comments:
Post a Comment