+ 1

Can anyone help me sort out this problem please. I am not getting an output if anyone figures out the error please tell me.

print"Enter Any Number" num=gets if num < 7 puts "smaller than 7" if num > 42 puts " greater than 42 end end

26th Jun 2018, 5:07 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
1 ответ
+ 3
num=gets.to_i if num < 7 puts "smaller than 7" elsif num > 42 puts "greater than 42" end
26th Jun 2018, 5:10 AM
Hatsy Rei
Hatsy Rei - avatar