Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need this table filled in. I'll give thumbs up #include OOO OOTAGON void fun (int x) { if (x > 0) { fun (--x);

I need this table filled in. I'll give thumbs up

image text in transcribedimage text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

#include OOO OOTAGON void fun (int x) { if (x > 0) { fun (--x); printf("%d\t", x); fun(--x); 11 int main() { int a = 3; fun(a); return 0; 15 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) Il stack Table 1: Question 1 part b: funcion call stack table Last function call | Last function Function parameters (if applicable) ) return (for function that is (if applicable) called or returned) Output value (if application) main N/A N/A N/A fun N/A I=3 N/A main a=3 r= a fun I=3 main a=3 I=3 fun I= 2 fun I=3 main a=3 I= 2 = 3 fun I= 3 main a = 3 I= 3 fun = 3 main a=3 I= 3 Function parameters (for function that is called or returned) Output value (if application) fun = 0 Call stack | Last function call | Last function (if applicable) (if applicable) fun = 1 fun I = 2 N/A fun I= 3 main a=3 I=3 fun I= -1 fun = 1 fun I= 2 fun I= 3 main a=3 I=3 I= -1 Call stack | Last function call | Last function (if applicable) return (if applicable) Function parameters (for function that is called or returned) Output value (if application) fun = 3 main a=3 I=3 r= 2 Call stack Last function call | Last function (if applicable) return (if applicable) Function parameters for function that is called or returned) Output value (if application) 15 fun = 1 fun r= 3 main a=3 r= 3 fun 16 fun I= -1 fun = 1 fun I = 3 main a=3 I = 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain the process of MBO

Answered: 1 week ago