Wrote c code for GCD