Prime Number

Write a function to check if a number is a prime number. A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. 2 is a prime number, 3, 5, 7, 11, 13, 17, 19 and so on are prime numbers.

def PrimeNumber?(number)
  # your magic
end
PrimeNumber?(13) #should return true
PrimeNumber?(10) #should return false

results matching ""

    No results matching ""