What is an output of recursion


Discussion:

Q: Consider the following function:

int Func(int x)
{
if(x == 0)
return 2;
else if(x == 1)
return 3;
else
return (Func(x - 1) + Func(x - 2));
}

What is the output of the following statements?

a. cout<

b. cout<

c. cout<

d. cout<

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: What is an output of recursion
Reference No:- TGS01937734

Now Priced at $25 (50% Discount)

Recommended (92%)

Rated (4.4/5)