Created
May 8, 2016 17:54
-
-
Save Rushi98/7f06deb777f5970509955c9604a6676d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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