@hitendra: Bro, let me explain you how global a & b values changing:
a = 10 , b = 20
after line C() of main
a = 23 , b = 20 (1st line of output)
Now C() calling D(), which caused b to be changed. So
a = 23 , b = 44 (2nd line of output)
Now D() calling E() which prints 2nd line of output,and then changing value of a & b
a = 1, b = 2 (3rd line of output)
Now Backtracking starts , so D() prints current global value which is above
Then C() comes into picture after D() is over, which changes global value again,
a = 6, b = 7
Now , main() comes into picture which has local a (we represent it as aL) and b (we represent it as bL), so
aL = 2 , bL = 3 (It is different from global a & b)
Again we are calling E(), which prints current global value and also changing values too.
a = 6, b = 7 (4th line of output) and changes values also, so
a = 1 , b = 2
and we are back to main() , so printing local values as main() referred its local ONLY,so
a = 2 , b= 3 (5th line of output) which is nothing but aL = 2 , bL = 3.
Hence final output is
23 20
23 44
1 2
6 7
2 3