diff --git a/da2YVv/hVaZ6X.rb b/da2YVv/hVaZ6X.rb new file mode 100644 index 0000000..8361498 --- /dev/null +++ b/da2YVv/hVaZ6X.rb @@ -0,0 +1,19 @@ + +def gcd(a, b) + while b != 0 + a, b = b, a % b + end + return a +end + + +def lcm(a, b) + return (a * b) / gcd(a, b) +end + +# Example usage +num1 = 12 +num2 = 18 +result = lcm(num1, num2) + +puts "The LCM of #{num1} and #{num2} is #{result}"