Skip to content

Instantly share code, notes, and snippets.

@Rushi98
Created May 8, 2016 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rushi98/7f06deb777f5970509955c9604a6676d to your computer and use it in GitHub Desktop.
Save Rushi98/7f06deb777f5970509955c9604a6676d to your computer and use it in GitHub Desktop.
def gcd(a,b):
if a>b:
return trugcd(a,b)
else:
return trugcd(b,a)
def trugcd(a,b):
x=a%b
if x==0:
return b
else:
return trugcd(b,x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment