title: Why is my linked list while loop not working? (C)
body: <p>I am unsure why the code below does not execute up to the while loop. It only gives this output:<a href="https://i.stack.imgur.com/qD9la.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>The desired output of this program is that the largest node of the linked list is taken, multiplied by 0.8, and then printed as an output.</p>
  <pre><code>Code:
  struct Process{
  int burst_time;
  struct Process* next;
  };
  
  int main()
  {
  int i;
  struct Process* head = NULL, *temp = NULL;
  struct Process* current = head; // Reset the pointer
  int proc_count, time_quantum, total_time;
  // BTmax
  int max = 0;
  printf(&quot;How many processes?: &quot;);
  scanf(&quot;%d&quot;,&amp;proc_count);
  for(i = 0; i &lt; proc_count; i++)
  {
      temp = malloc(sizeof(struct Process));
      printf(&quot;\nEnter burst time of process %d: &quot;, i + 1);
      scanf(&quot;%d&quot;, &amp;temp -&gt; burst_time);
      temp-&gt;next=NULL;
      if(head==NULL)
      {
          head=temp;
          current=head;
      }
      else
      {
          current-&gt;next=temp;
          current=temp;
      }
  }
  current = head;
  // BTmax * 0.8
  while(current != NULL)
  {
      if (head -&gt; burst_time &gt; max)
      {
          max = head-&gt;burst_time;
      }
      head = head-&gt;next;
  }
  time_quantum = max * 0.8;
  printf(&quot;\nTime Quantum is: %d&quot;, time_quantum);
  </code></pre>