Question: Tracing the Recursion. Observe the recursive solution provided below. 1 int fun ( int a ) k 2 If ) = = ( 0 3

Tracing the Recursion. Observe the recursive solution provided below.
1 int fun(int a)k
2 If )==(0
3 return 0 ;
4 else
5 return fun (a-1)+a;
63
7 int main(){
8 fun(3);
9 return 0 ;
10
a. Which line(s) of this program define(s) the base case of fun() method? (5 points)
b. Which line(s) of this program include recursive call(s)?(5 points)
c. Trace the recursion below (You must show the trace step by step, otherwise no credit!)(10 points)
d. At what step of your recursion tracing did you hit the base case? (5 points)
e. What is the final output of this code? (5 points)
Tracing the Recursion. Observe the recursive

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!