+ 1

Why it shows ā€œoddā€?

It should show ā€œevenā€ coz for example 4 % 2 = 0ā€¦ https://code.sololearn.com/c8I2THnw5IME/?ref=app

28th Nov 2022, 1:13 PM
ŠŸŠ¾Š»ŠøŠ½Š°Š”
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
28th Nov 2022, 1:35 PM
Jayakrishna šŸ‡®šŸ‡³
+ 1
Thanks :) didnā€™t know that
28th Nov 2022, 1:50 PM
ŠŸŠ¾Š»ŠøŠ½Š°Š”