It's printing 0 infinitely because you're not passing the incremented value to test in the recursive call.
To make it work use
instead ofCode:test(++count); /*pre-increment*/
EDIT: Note that a new copy of the variable is created at each function call.Code:test(count++); /*post-increment*/