Hi all, I'm new to ruby.
Here is the example code I was trying to test.
But it popped up an error message that like "failed to compare string object to 0".
So how to convert a string to an integer?
Thanks a lot!
print "input a integer" x = gets.chomp if x > 0 print "Positive" elsif x < 0 print "Negative" else print "zero" end