#6 - Prime number or not
Determine whether a given number is a prime number.
A prime number is a natural number greater than 1 that has exactly two distinct positive divisors: 1 and itself.
In simpler terms, a prime number cannot be evenly divided by any other numbers except 1 and the number itself.
Examples of prime numbers are
2, 3, 5, 7, 11, 13, 17, 19 and so on.
Example 1
Input:
N = 7
Output:
Prime number
Example 2
Input:
N = 12
Output:
Not Prime Number
Video Solution
Last updated