I am getting a run-time error with my previous approach of the same question. I spent quite a time trying to figure out the problem but it seems I am missing something.
The function ReverseList returns the last element after reversing the k elements in the main function. I try to connect this with the farHead2 node pointer which is the pointer which should get linked after the complete process. For eg if k=3 and n=9, in first iteration farHead1 points at 4th element and farHead2 points at 6th element;
My code: https://ide.codingblocks.com/s/99415