c:gcd function