Linklist k append

sir in this question of linked list k append , it is showing wrong answer for 3 test cases and 1 test case is correct though my output is correct . can you plzz tell why??
link of my code:https://ide.codingblocks.com/s/104558

@khushi91200
You have not considered the case when k is larger than n. It is explicitly mentioned in the problem statement that K can be greater than N.
In such a case , take modulo of k with n.
k = k % n ;
Do this and then call the append function.
Also do not forget to consider the corner case when k is a multiple of n.

sir i did this and it is showing run error for 2nd test case,rest all are passed link:https://ide.codingblocks.com/s/104570. but i didnt understood the corner case

@khushi91200
Only requires a slight modification.
If k is a multiple of n then k%n will come out to be 0.
So check for that.
k=k%n;
if( k == 0 ) {
//Simply print the list without doing anything
}
else {
//Call the append function then print the list
}