Question: Question 1 (25 marks) Consider the following code, and answer the questions. 1 #include 3 void fun (int x) { if (x > 0) {

 Question 1 (25 marks) Consider the following code, and answer the

Question 1 (25 marks) Consider the following code, and answer the questions. 1 #include 3 void fun (int x) { if (x > 0) { fun (--x); printf ("%d\t", x); fun (--x); O . 9 } 5 int main() { int a = 3; fun(a); return 0; 152 a) What is the output? (4 marks) b) Complete the progression of the function call stack for the program in the given table at the end of this document. Each time there is a new function call or a function returns, there should be a depiction of the call stack. This is shown by adding the new function call on top of the previous function calls or removing the function on top when a value is returned by that function. the first coulumn on the left is a depiction of the call stack and every other column must be filled with respect to that. Please notice that every time the stack changes, it must be written in the next row again. (Please refer to page 5 for the call stack table) (21 marks)

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 Databases Questions!