Created
December 16, 2013 01:59
-
-
Save fenixbrassi/7981328 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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