Describer the action of the function


Discuss the below:

Q: Trace the following program and give the return value for each function call:

int h (int b, int n)
{
if ( n = = 0)
return 1;
else
return(b * h(b, n-1));
}

(a). What are values for h(), assuming function calls as follows:

i. h(5,3)

ii. h(3,5)

iii. h(2,2)

(b). Describer the action of the function. What is the function in the library that performs a similar calculation?

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Describer the action of the function
Reference No:- TGS01939377

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)