title: Unexpected Output when adding two float numbers
body: <p>I wrote the following C++ code:</p>
  
  <pre><code>float a, b;
  int c;
  
  a = 8.6;
  b = 1.4;
  c = a + b;
  
  printf("%d\n", c);
  </code></pre>
  
  <p>The output is <code>10</code>.</p>
  
  <p>But when I run the following code:</p>
  
  <pre><code>float a, b;
  int c;
  
  a = 8.7;
  b = 1.3;
  c = a + b;
  
  printf("%d\n", c);
  </code></pre>
  
  <p>The output is <code>9</code>.</p>
  
  <p>What is the difference between the two, as they are giving different outputs?</p>