Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 478 Bytes

File metadata and controls

34 lines (29 loc) · 478 Bytes

Is A Number Prime

Easy


  1. You've to check whether a given number is prime or not.
  2. Take a number "t" as input representing count of input numbers to be tested.
  3. Take a number "n" as input "t" number of times.
  4. For each input value of n, print "prime" if the number is prime and "not prime" otherwise.

Sample Input:

5
13
2
3
4
5

Sample Output:

prime
prime
prime
not prime
prime

Constraints:

1 <= t <= 10000
2 <= n < 10^9