Run Error K Append

https://ide.codingblocks.com/s/178204 This is working fine for some test cases but showing run error for some. What should I change?

Pls consider the cases when your k is greater than n …so try to take mod value of k as k=k%n
So if k==0 print the linked list
Else call append function and then print …

Hi, I changed that and this is the amended code: https://ide.codingblocks.com/s/178204
Still one test case is having run error. Please help