Find GCD (Greatest Common Divisor) of two integer
// Source : http://www.math.wustl.edu/~victor/mfmm/compaa/gcd.c
/* Standard C Function: Greatest Common Divisor */
int
gcd ( int a, int b )
{
int c;
while ( a != 0 ) {
c = a; a = b%a; b = c;
}
return b;
}
/* Recursive Standard C Function: Greatest Common Divisor */
int
gcdr ( int a, int b )
{
if ( a==0 ) return b;
return gcdr ( b%a, a );
}