If it is a nonzero : nonzero « Number « Ruby






If it is a nonzero


op = 2

if op.nonzero? # is it nonzero?
  puts 12 / op
else
  puts "Can't divide by zero."
end

 








Related examples in the same category

1.If it is not a zero, then
2.Is it a zero
3.Is it a nonzero