Ruby program to check a number is zero or not using the zero?() function
# Ruby program to check a number
# is zero or not using the zero?()
# function
num1 = 0;
num2 = Complex(0,0);
num3 = Complex(2,0);
print "Num1: " ,num1.zero?();
print "\nNum2: ",num2.zero?();
print "\nNum3: ",num3.zero?();
Num1: true
Num2: true
Num3: false
Table of Contents