title: How to set precision for float in C++
body: <p>I want to set precision for float in C++. Suppose my code is</p>
  
  <p><code>float a = 23.5, b = 24.36;
  float c = a + b;</code></p>
  
  <p>and if I print this</p>
  
  <pre><code>cout &lt;&lt; c;
  </code></pre>
  
  <p>It gives:
  46.86</p>
  
  <p>But I want to print till one digit after the decimal point.
  How to do that?</p>