Answer:
Check the explanation
Explanation:
a) main calls fun1; fun1 calls fun2; fun2 calls fun3
fun3() d, e, f
fun2() c, d, e
fun1() b, c, d
main() a, b,c
CALL STACK SHOWING THE VARIABLES OF EVERY FUNCTION
From the above call stack diagram, it is very clear that the last function call is made to fun3().
In fun3(), the local variables "d, e, f" of fun3() will be visible
variable "c" of fun2() will be visible
variable "b" of fun1() will be visible
variable "a" of main() will be visible
b) main calls fun1; fun1 calls fun3
fun3() d, e, f
fun1() b, c, d
main() a, b,c
CALL STACK SHOWING THE VARIABLES OF EVERY FUNCTION
From the above call stack diagram, it is very clear that the last function call is made to fun3().
In fun3(), the local variables "d, e, f" of fun3() will be visible
variable "b, c" of fun1() will be visible
variable "a" of main() will be visible
c) main calls fun2; fun2 calls fun3; fun3 calls fun1
fun1() b, c, d
fun3() d, e, f
fun2() c, d, e
main() a, b,c
CALL STACK SHOWING THE VARIABLES OF EVERY FUNCTION
From the above call stack diagram, it is very clear that the last function call is made to fun1().
In fun1(), the local variables "b, c, d" of fun1() will be visible
variable "e, f" of fun3() will be visible
variable "a" of main() will be visible
d) main calls fun1; fun1 calls fun3; fun3 calls fun2
fun2() c, d, e
fun3() d, e, f
fun1() b, c, d,
main() a, b,c
CALL STACK SHOWING THE VARIABLES OF EVERY FUNCTION
From the above call stack diagram, it is very clear that the last function call is made to fun2().
In fun2(), the local variables "c, d, e" of fun2() will be visible
variable "f" of fun3() will be visible
variable "b" of fun1() will be visible
variable "a" of main() will be visible
The last function called will comprise of all its local variables and the variables other than its local variables from all its preceding function calls till the main function.