mirror of
https://github.com/RustyRaptor/isOddOrEven-collection.git
synced 2026-12-03 18:55:15 -07:00
Create oddoreven.rb
This commit is contained in:
1 parent
ff2635b6d2
commit
2f27939477
1 file changed
+7
@@ -0,0 +1,7 @@
|
||||
def oddornot(num)
|
||||
if num.modulo(2) == 1
|
||||
puts "Odd"
|
||||
elsif num.modulo(2) == 0
|
||||
puts "Even"
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user