Final answer:
The output of the code would be 25, 15, 15.
Step-by-step explanation:
The output of the code would be:
- 25
- 15
- 15
The initial value of val is 25, which is printed first. Then, the function example() is called where the global val is changed to 15 and printed. Finally, after the function call, the value of val is still 15 and is printed again.