Answer:
a. x = 5
b. x = 7
Step-by-step explanation:
a)
OUTPUT: x = 5
In the main() function, fun1() is evaluated first and it updates the value of the global variable to 2 and returns 3.
The second function returns the value of the global variable 'a' and this variable has value 2.
So,
x = 3 + 2
x = 5
b)
OUTPUT: x = 7
In the main() function, fun2() is evaluated first and it returns 4 because global variable 'a' is initialized with value 4.
The second function fun()1 will returns the value 3.
So,
x = 4 + 3
x = 7