Test case not passing

In the given problem I am not able to figure out why i am not able to pass one of the test cases. I have considered the case for both negative and positive input.
Here is a link to the code.

@bluejay,
I have corrected your code https://ide.codingblocks.com/s/188519

Ok , Got it. Thanks.