Hi shilpa!
the confusing thing is the method another(valhold v,int i),it has used the same name v ,which is different from original v.Let us take it as v1.Now when we call this method,v1 is also pointing to the i of v ,when we set v1.i=20(originally v.i in the question),the i of main v also gets value 20.Then the value of v1 is pointed to vh,which has nothing to do with original v whose value is set to 20.Hence it gives twenty.
hope u get it.Any doubts u can mail me at
puneetpruthi@usa.net