Why 4.7 is 4.6999999 in c : <p>'</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;math.h&gt;

int main(){  
        int i;  
        float num = 4.700;   
        for(i=1;i&lt;5;i++){ 
              printf("%0.3f\tx%d\t\t=%d\n",num,(int)pow(10,i),(int)(num*pow(10,i)));
        }  
        return 0;
}
</code></pre>

<p>'
This code prints the following to the console:
'  </p>

<pre><code>4.7000   x10        =46  
4.7000   x100       =469  
4.7000   x1000      =4699  
4.7000   x10000     =46999
</code></pre>

<p>'
This result is not consistent with all floating point values  </p>

<p>1.2000 prints out ...120...1200 etc<br>
1.8000 is strange again</p>

<p>I am working in Codeblocks and my question is why do some floats react this way?I there something fundamental to C or the mingw compiler that I am missing? Or is there something wrong with my code?<br>
Thanks for the help and sorry if it's a repeat question</p>
