A static local variable is different from a local variable as a static local variable is initialized only once no matter how many times the function in which it resides is called and its value is retained and accessible through many calls to the function in which it is declared.
If a variable is declared static in a function, the same variable/same copy will be used for all recursive calls of that function.
Static variables are allocated memory in the data segment, not stack segment. In this case, d is initialized explicitly so it will be stored in initialized data segment.
Check this - http://www.geeksforgeeks.org/memory-layout-of-c-program/
here count(3) will do 3 things - prints 31, increments d and call count(2)
count(2) - print 22, increments d and call count(1)
count(1) - print 13, increments d. Now as 0 $\ngtr 1$ , of it will print final value of d i.e 4 and returns to count(2). count(2) will print 4 and returns to count(3), At last count(3) will print 4.
Final output - 312213444
A is the correct answer.