title: how to add node to the end(singly linked list)
body: <pre><code>void addToEnd()
  {
      newnode = (struct node*)malloc(sizeof(struct node));
  
      printf ("Enter the customer name :");
      scanf ("%s", newnode-&gt;cName);
  
      printf ("\nEnter customer number :");
      scanf ("%d", &amp;newnode-&gt;cNumber);
  
      printf ("\nEnter transaction description :");
      scanf ("%s", newnode-&gt;tDescrip);
  
      newnode-&gt;next = NULL;
      if(list==NULL)
          list = newnode;
      else if (list != NULL &amp;&amp; newnode &lt; list)
      {
          newnode-&gt;next = list;
          list = newnode;
      }
      else
      {
          temp = list;
          while (temp != NULL)
          {
              if (newnode &gt; temp)
              {
                  prev = temp;
                  temp = temp-&gt;next;
              }
          }
          newnode-&gt;next = prev-&gt;next;
          prev-&gt;next = newnode;
      }
  }
  </code></pre>
  
  <p>i tried this code, but tis code is just add to start but not to end, how am i suppose to add the node to the end?</p>