So I was working on my program which is suppose to ask the user to enter
an integer and the program is suppose to return odd or even depending on
that integer. I am new to coding and the below code is what I came up
with but its not working at all. I am using eclipse not the IRB. If
anyone would like to steer me in the right direction in a basic text
format would be helpful.
puts “input an integer value”
num1 = STDIN.gets
num1.chop!
num1 = num1.to_i
if
num1 0> 1.even?
false
puts “odd”
else
if
num 0> 2.even?
true
puts “even”
end
end