Can you tell me hoe to take input from user in linked list


this is my code

In the question, you have to take n values of linked list, so you can use two different functions together,
You can take a function : buildlist(head,N);
In the function, you can take a data, and use the following condition to build list.
while(N>0)
{
cin>>data;
insertAtTail(head,data);
N–;
}

In this function you are required to use insertAtTail function which will insert the data at end of linked list. In this way you can approach the question.