here is the code pls check
When building the list its printing the first element twice can any one figure this out
in the inserttail function at line 29
void insertattail(node*&head,int data){
if(head == NULL) {
head = new node(data);
return; // add this return statement else 2 nodes were being formed
}
Can i have any other alternative to build the list without using the end point as -1
No sir it is the only way to take input
like thats how the question is designed so there is no other way