I want to find GCD of two numbers but without using division or mod operator.
one obvious way would be to write own mod function like this:
enter code here
int mod(int a, int b)
{
while(a>b)
a-=b;
return a;
}
and then use this function in the euclid algorithm.
Any other way ??
You can use the substraction based version of euclidean algorithm up front: