Solved

In the Following Code That Uses Recursion to Find the Greatest

Question 5

Multiple Choice

In the following code that uses recursion to find the greatest common divisor of a number, what is the base case? public static int gcd(int x, int y)
{
If (x % y == 0)
Return y;
Else
Return gcd(y, x % y) ;
}


A) gcd(int x, int y)
B) if (x % y == 0)
Return y;
C) else
Return gcd(y, x % y) ;
D) Cannot tell from this code

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions