Skip to content

Commit

Permalink
Merge pull request #61 from Phantsure/patch-2
Browse files Browse the repository at this point in the history
Create euclidean_algo_GCD_basic.py
  • Loading branch information
i-vishi authored Oct 2, 2018
2 parents 76eefae + f05e6ab commit be9cf84
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Mathematics/euclidean_algo_GCD_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Python program to demonstrate Basic Euclidean Algorithm
# Function to return gcd of a and b
def gcd(a, b):
if a == 0 :
return b
return gcd(b%a, a)

# example with 2 numbers which could be taken as input also
a = 10
b = 15
print(gcd(a, b))

0 comments on commit be9cf84

Please sign in to comment.