Ruby program to find the GCD using library function
# Ruby program to find the
# GCD using library function
print "Enter number1: ";
num1 = gets.chomp.to_i;
print "Enter number2: ";
num2 = gets.chomp.to_i;
result = num1.gcd(num2);
print "Greatest Common Divisor: ",result;
Enter number1: 12
Enter number2: 16
Greatest Common Divisor: 4
Table of Contents