Link to exercise (it's a review lesson where i should make something i wanted)
I'm not exactly sure, can i, as i have done in the code, set a variable to 'gets.chomp' and then use it in an if-elsif-else statement. Please tell me if there is something wrong with my code:
print "Type an integer and the program will configure out wether it is positive, negative, or just 0:" variable = gets.chomp if variable > 0 print "Your number is a positive integer" elsif varible < 0 print "Your number is a negative integer" else print "Your number is 0" end
It also outputs this error message:
comparison of String with 0 failed
I don't understand that error message. Can you help me?