in reply to Finding the greatest common divisor
Use the shoulders of an ancient genius :) You could use Euclidean algorithm to find GCD. It's very simple: you can find info here. (http://www.nist.gov/dads/HTML/euclidalgo.html)