title: Adding nodes to end of a linked list in C
body: <p>The code I have is adding nodes to head but I want them added to tail. I tried pointing head to next node to null but it stops since the next node is null</p>
  
  <pre><code>if(head==NULL)
  {
      head=node;
  }
  else
  {
      node-&gt;next=head;
      node-&gt;prev=NULL;
      head-&gt;prev=node;
      head=node;
  }
  printf("The node is inserted to linked list succesfully. \n\n");
  printMenu();
  </code></pre>