title: scanf float, print float, different value?
body: <pre><code>#include "stdafx.h"
  #include "stdio.h"
  #include "math.h"
  
  int main()
  {
  float c;
  
  printf("Type c");
  
  scanf("%f", &amp;c);
  
  
      printf("C is c: %f ",c);
  
      while(getchar()!='\n');
      getchar();
      return 0;
  
      }
  </code></pre>
  
  <p>Very simple code, I just started with C.
  With most numbers works ok but for example if I input 47.2 then It prints me 47.200001 with 88.4321 outputs 88.432098
  but with other numbers like 5.4 works ok 5.400000
  I am using Microsoft Visual Studio 10.</p>
  
  <p>Another thing if the above code instead of putting float c I put double I am not able to printf What should I put instead of %f?
  But It worries me more my first question, maybe It is something to do with the compiler maybe I am compiling c code as c++, I dont know.</p>