# Answer to Question #3373 in Python for mukunda

Question #3373

Write a program to find the Greatest common divisor in recursive method

Expert's answer

def gcd_rec (a, b, x):

if a % x == 0 and b % x == 0:

& return x

return gcd_rec (a, b, x-1)

def gcd (a, b):

return gcd_rec (a, b, min(a,b)-1)

print(gcd(8,12))

if a % x == 0 and b % x == 0:

& return x

return gcd_rec (a, b, x-1)

def gcd (a, b):

return gcd_rec (a, b, min(a,b)-1)

print(gcd(8,12))

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment