Help in DECSTR

Can some one help me in this problem.

Here is the link to my code: CodeChef: Practical coding for everyone

Think about the condition when y=0.