Class: A1426kt_prime_number
- Inherits:
-
Object
- Object
- A1426kt_prime_number
- Defined in:
- lib/a1426kt_prime_number.rb
Instance Method Summary collapse
-
#determine_prime(num) ⇒ Object
Your code goes here…
Instance Method Details
#determine_prime(num) ⇒ Object
Your code goes here…
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/a1426kt_prime_number.rb', line 5 def determine_prime(num) if num == 1 || num == 2 then return "This is the prime number." end if num % 2 == 0 then return "This is not the prime number." end i = 3 while true if num == i then return "This is the prime number." end if num % i == 0 then return "This is not the prime number." end i = i + 2 end end |