Node at k distance from target node

my code gives wrong output for some inputs
can you tell my mistake in my code

@aattuull, there were some silly errors
I have corrected your code:: https://ide.codingblocks.com/s/245297
I have commented out your errors

In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved if you got the answer