title: Scanf is not waiting for input
body: <p>I know scanf waits for input. 
  But in this program I have written it is printing 
  <strong>hello</strong> in an infinite loop. Its not waiting for me to enter. </p>
  
  <pre><code>#include &lt;signal.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;sys/time.h&gt;
  #include&lt;unistd.h&gt;
  
  void timer_handler (int signum)
  {
   static int count = 0;
   printf ("timer expired %d times\n", ++count);
  }
  
  int main ()
  {
   struct sigaction sa;
   struct itimerval timer;
  
  
   memset (&amp;sa, 0, sizeof (sa));
   sa.sa_handler = &amp;timer_handler;
   sigaction (SIGALRM, &amp;sa, NULL);
  
  
   timer.it_value.tv_sec = 0;
   timer.it_value.tv_usec = 250000;
   /* ... and every 250 msec after that. */
   timer.it_interval.tv_sec = 1;
   timer.it_interval.tv_usec = 250000;
   /* Start a virtual timer. It counts down whenever this process is
     executing. */
   setitimer (ITIMER_REAL, &amp;timer, NULL);
  
   /* Do busy work. 
   */
   int i=0;
   while(1){
      scanf("%d",&amp;i);      //****Not waiting for input****
      printf("hello");   
  }
  }
  </code></pre>
  
  <p>Output : </p>
  
  <pre>
  timer expired 1 times
  hello timer expired 2 times
  hello timer expired 3 times
  hello timer expired 4 times
  hello timer expired 5 times
  hello timer expired 6 times
  hello timer expired 7 times
  </pre>
  
  <p>Why ?</p>
  
  <p>?</p>