# # Compute the greatest common divisor of two integers using Euclid's # algorithm. # # Parameters: # x and y: The integers for which the GCD is computed # # Returns: The GCD of x and y # def gcd(x, y): # The print statement shows how quickly Euclid's algorithm finds the GCD # even for huge numbers. print(f"Computing the GCD of {x} and {y}") if x % y == 0: # Base case return y else: # Recursive case return gcd(y, x % y) # Demonstrate the GCD function. a = int(input("Enter a positive integer: ")) b = int(input("Enter another positive integer: ")) print(f"The GCD of {a} and {b} is {gcd(a, b)}.")