# gcd in Ruby # Alice E. Fischer # May 4, 2009 def gcd( a, b ) if a0 rem = a.modulo b a = b b = rem end end return a end x=138 y=2598 puts "The GCD of " + x.to_s + "and " + y.to_s + " is " k = gcd( x, y ) puts k # The GCD of 138 # and 2598 is # 6