Consider the following function:
int recEx13(int x)
{
if (x
return 0;
else if (x == 1)
return 2;
else
return (recEx13(x - 1) + recEx13(x - 2)
+ recEx13(x - 3));
}
What is the output of the following statements? (4, 6)
a. cout <><>
b. cout <><>
c. cout <><>
d. cout <>
Consider the following recursive function:
void recFun(int x, int y)
if (x > 0 && y > 0)
if (x >= y && y != 0)
cout <><>
recFun(x - y, y);
else if (y > x && x != 0)
recFun(y - x, x);
Else
cout <>
a. recFun(180, 38);
b. recFun(75, 26);
c. recFun(13, 86);
d. recFun(56, 148);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here