Doubt in " Kth element from last in linked list"

MY output show runtime error .Please tell me what is wrong in my code.

Rahul, in your print function which you have used, the approach you are using is wrong, thts why u are getting runtime error, so plz use the runner technique of fast and slow nodes, where initially your slow and fast nodes will point towards head, and then uptil k, you will make jumps, and move only the fast pointer, and after that while(fast!=NULL), move both fast as well as slow pointers simultaneoulsy,
Slow data will be your kth element from last, so print it.

i got it but can you tell me why i can not get answer . It does not print any output.

This is so because you have used the logic in printing only, but you need to manipulate the pointers as well correctly, since there was no syntax error, thts why it works successfully but didnt produce any sort of results…