title: Why does scanf fail with floats?
body: <p>When I write this, compile it, and run:</p>
  <pre><code>int x;   
  scanf (&quot;%d&quot;, &amp;x);  
  while (x!=4) {  
      scanf (&quot;%d&quot;, &amp;x);  
  }
  </code></pre>
  <p>then when inserting <code>char</code> or <code>double</code> number less than 4 it enter an infinite loop. When inserting double greater than 4 it terminates.</p>
  <p>Any explanation for this?</p>