# L-11 MCS 260 Fri 21 Sep 2007 loop for gcd # # prints the greatest common divisor of two # user given positive numbers # print 'The Greatest Common Divisor' a = input('Give a : ') b = input('Give b : ') # save numbers for output later s = 'gcd(%d,%d) = ' % (a,b) r = a % b # initialization while r <> 0: a = b b = r r = a % b print s + '%d' % b