#Credits to NPTEL MOOC, Programming, Data Structures & Algorithms in 
#Python by Madhavan Mukund, Chennai Mathematical Insti
tute

def gcd(m,n):
  i = min(m,n)
  while i > 0:
    if (m%i) == 0 and (n%i) == 0:
      return(i)
    else:
      i = i-1

Source link

Greatest common divisor program with looping

Leave a Reply

Your email address will not be published. Required fields are marked *