Linked list K Append

sir, it is taking wrong input of k. when I’m using cout for any value of k that I enter it is showing 0 whereas on the IDE it is showing the correct K. Beacuse of this my test cases are failing. kindly look into the matter.

Hi Khushi
Can you share your code