+ 2
Hi friends ,encountered with another problem...
this was the code- print "Enter your name:" x=gets print "welcome #{x} , Have a great day ahead" print "enter your age:" y=gets if y < 18 puts "You Are An Adult Now" else puts "You Are A Child Now" end
3 Respostas
+ 8
you can't compare string to integer(gets method returns a string); it should be "y = gets.to_i" so the code works correctly.
+ 1
The program runs nicely until line 6
+ 1
if anyone figures any syntax error plz tell me