title: How to use printf to view float type variables?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7197589/c-what-is-the-printf-format-spec-for-float">C++: What is the printf() format spec for &ldquo;float&rdquo;?</a>  </p>
  </blockquote>
  
  
  
  <p>I am new to C++ , and Use the classic Borland Turbo C++</p>
  
  <p>with the graphics initialized , when i use printf the following way, it shows value 0. but when i use cout the correct value is displayed</p>
  
  <pre><code>float x=10;
  printf("%d",x);   // displays 0
  cout&lt;&lt;x;        // displays 10
  </code></pre>