Answer
(a) The printout will be following-
2
3.4
2
4
(b) The printout will be following-
3
6
5
Work Step by Step
(a) When function is called it is given the argument 2 for parameter x, so in the first line of function it will print 2, then the next 2 lines will change the values of x and y but only in the scope of the function. Then the function will also print the modified value of y that is 3.4. Then after the function ends the value of x and y will not be updated and printed as it is, because the changes were only in the scope of the function.
(b) In the first call the function is called with 1 as argument of all parameters x, y and z. It will return x+y+z that is 3, which will be printed. In the second call the values of x, y and z will be 2, 1, 3 and the return value will be 2 + 1 + 3 = 6. In the third call the value for y is not provided so it will take default value mentioned in function header and the return value will be 1+1+3 = 5.