Assume x >= y and y > 0 what does the following code do?
int F(int x, int y)
{
if (y == 0)
return x;
else
return F(y, x % y);
}
1
finds greatest common divisor
2
finds least common multiple
3
finds greater of x and y
4
finds smaller of x and y
Assume x >= y and y > 0 what does the following code do?
int F(int x, int y)
{
if (y == 0)
return x;
else
return F(y, x % y);
}
finds greatest common divisor
finds least common multiple
finds greater of x and y
finds smaller of x and y