If it is not a zero, then : nonzero « Number « Ruby






If it is not a zero, then


op = 0
if !op.zero? # not a zero?
  puts 12 / op
else
  puts "Can't divide by zero."
end

 








Related examples in the same category

1.If it is a nonzero
2.Is it a zero
3.Is it a nonzero