// Iterative algorithm
int gcd( inta, int b)
{
int temp;
while(b)
{
temp = a % b;
a = b;
b = temp;
}
return(a);
}
// Recursive algorithm
int gcd_recurse( inta, int b)
{
int temp;
temp = a % b;
if (temp == 0)
return(b);
else
return(gcd_recurse(b, temp));
}