Skip to content

Instantly share code, notes, and snippets.

@fenixbrassi
Created December 16, 2013 01:59
Show Gist options
  • Save fenixbrassi/7981328 to your computer and use it in GitHub Desktop.
Save fenixbrassi/7981328 to your computer and use it in GitHub Desktop.
def give_greates_common_divisor(x,y)
x.to_i.gcd(y.to_i)
end
puts "Give the first number"
x = gets
puts "Give the second number"
y = gets
puts "the greates common divisor is: " +
give_greates_common_divisor(x,y).to_s
-.------------------
Result in console :
Give the first number
10
Give the second number
20
the greates common divisor is: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment