You are correct Nitika Gupta.Internally how it will change it does not matter,What matters in the actual value of n will be changed by which is passed by D to W
Also, in the answer it says that
here, because of dynamic scoping the value of n passed in w(n) will be n=3.
I dont think dynamic scoping will have any role here,because as long as we have local variable(x),it will be used.Scoping comes into picture,when variable getting used is not defined in the scope of the function which is using it.