three test case gives run error,i think my approach is right
Https://ide.codingblocks.com/s/174898
@Jitu748 you are not handeling condition when k>n thats why it is giving runtime error ,please add this condition if (k<n) in k_th_node() function.Please try it and if you still not get it ,I will change your code. 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.