Question: Trace the following code, puying attention to the recursive function calls. Here, lent) and area (1) are the variables from the first call to the
Trace the following code, puying attention to the recursive function calls. Here, lent) and area (1) are the variables from the first call to the triangle area function, Len(2) and area (2) are the variables from the second call, and so on. Press start to begin. Start int triangle_area(int len) len() are ( Ion (?) arna () Ion (s) arec (3) lon ( area ( int area; if (len - 1) area = 1; area - triangle arealen - 1); area - area len; return area: int main() abob-Schw gh int result - triangle_area(4) cout a result o endl; return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
