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...


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)



{



cout <><>



recFun(y - x, x);



}



}



Else



cout <>



}



What is the output of the following statements? (4, 6)


a. recFun(180, 38);


b. recFun(75, 26);


c. recFun(13, 86);


d. recFun(56, 148);



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here