Hint or Solution in C


#1

int gcd(int x, int y)
{
if(x==0)
return y;

 return gcd(y%x,x);

}
int Solution::cpFact(int a, int b)
{
while(gcd(a,b)!=1)
{
a= a/gcd(a,b);
}
return a;

}