K length reverse linked list


error in the code?
i guess there is some error while taking input?
what are the modification