title: How to use setprecision in C++
body: <p>I am new in <code>C++</code> , i just want to output my point number up to 2 digits.
  just like if number is <code>3.444</code>, then the output should be <code>3.44</code> or if number is <code>99999.4234</code> then output should be <code>99999.42</code>, How can i do that. the value is dynamic. Here is my code.</p>
  
  <pre><code>#include &lt;iomanip.h&gt;
  #include &lt;iomanip&gt;
  int main()
  {
      double num1 = 3.12345678;
      cout &lt;&lt; fixed &lt;&lt; showpoint;
      cout &lt;&lt; setprecision(2);
      cout &lt;&lt; num1 &lt;&lt; endl;
  }
  </code></pre>
  
  <p>but its giving me an error, undefined fixed symbol.</p>