Python Program to Find GCD of Two Numbers using Recursion – Method 2
Write Python Program to Find GCD of Two Numbers using Recursion – Method 2
# Write Python Program to Find GCD of Two Numbers using Recursion def gcd(n, m): if m == 0: return n else: return gcd(m, n % m) n = 72 m = 32 ans = gcd(n, m) print(f'GCD of {n} and {m} : {ans}')
Output:
GCD of 72 and 32 : 8