Linked list-k append: output is not changing

it gives the same linked list that i enter.

hey @ankityadav943, it is because compiler is not making i=-3 when you are doing i=-n;

so how can we solve it?

hey @ankityadav943, actually it is making i=-n. Actually problem is that you read the data in wrong way, that variable a is also counted nodes of LL. 0 is passed as n to append function. I have modified your build function you can check it here https://ide.codingblocks.com/s/110212

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.