Please check and resolve the error in my code.
Code is giving 1 less element than entered.
How to take user input without using -1 condition
Hey @tgoel5884
node*take_input(){
int d;
// cin>>d; removed this
node*head=NULL;
while(cin>>d){
insertathead(head,d);
}
return head;
}
Thanks, Solution worked
1 Like