+ 1
Why it shows āoddā?
It should show āevenā coz for example 4 % 2 = 0ā¦ https://code.sololearn.com/c8I2THnw5IME/?ref=app
3 Answers
+ 2
number = gets.chomp.to_i # convert to int
if number % 2 == 0
puts "even"
else
puts "odd"
end
# else use number.to_i
+ 1
Thanks :) didnāt know that