60 736
Assignments Done
97,9%
Successfully Done
In April 2018

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))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions