Print BST keys in the given range

I tried to solve this question and for the given input example in the question,my code worked fine. However, on submitting the code,the test case does not pass.
Kindly have a look into mu code and tell me where I’m wrong.
LINK : https://ide.codingblocks.com/s/328242

I found the error. Thanks!