app/site-content/proposals/2009/08/06/gcd.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 07 Aug 2009 01:03:56 +0530
changeset 12 aac4944aca52
parent 8 294ff7ac9cb6
permissions -rwxr-xr-x
With ACL registers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
294ff7ac9cb6 Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     1
def gcd(a, b):
294ff7ac9cb6 Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     2
  if a % b == 0:
294ff7ac9cb6 Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     3
    return b
294ff7ac9cb6 Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     4
  return gcd(b, a %b)
294ff7ac9cb6 Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     5
294ff7ac9cb6 Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     6
print gcd (10, 20)