title: scanf in while loop
body: <p>In this code, <code>scanf</code> works only once. What am I doing wrong?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  
  int main()
  {
      int i = 1;
      if (! fork())
      {
          while(i)
          {
              printf("Enter i");
              scanf("%d", &amp;i);
              fflush(stdin);
              fflush(stdout);
          }
      }
      else
      {
          printf("Parent\n");
      }
      return(0);
  }
  </code></pre>