In Static Scoping, if a variable is not defined in the Local space, it is looked in Globle Space.
In Dynamic Scoping, if a variable is not found in the Local space , it is looked in the place, where it recursive called.
In Static
gun() have local variable 'k' and pass updated value "6" ............
In fun(), there are no loval variable 'k' so in static dynamic it use GLOBLE variable and update then with k = i + 3 = 6+3 = 9
So in main() , print() print 9 .
Hope you will understand.