Here is my implementation for catlan number. It got failed for test case 0

What is wrong in this implementation. I used combinatorics formula in my implementation.
code url : https://pastebin.com/bAKPZ9Z0

Take unsigned long int to pass all test cases.