Answer:
In Python:
def gcd(m,n):
if n == 0:
return m
elif m == 0:
return n
else:
return gcd(n,m%n)
Step-by-step explanation:
This defines the function
def gcd(m,n):
If n is 0, return m
if n == 0:
return m
If m is 0, return n
elif m == 0:
return n
If otherwise, calculate the gcd recursively
else:
return gcd(n,m%n)
To call the function to calculate the gcd of say 15 and 5 from main, use:
gcd(15,5)