title: C++ equivalent of printf() or formatted output
body: <p>I am relatively new to the C++ world.
  I know <code>std::cout</code> is used for console output in C++. But consider the following code in C :</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main(){
      double dNum=99.6678;
      printf("%.02lf",dNum);
      //output: 99.67
   return 0;
  }
  </code></pre>
  
  <p>How do I achieve the similar formatting of a double type value upto 2 decimal places using <code>cout</code> in C++ ?</p>
  
  <p>I know C++ is backward compatible with C. But is there a printf() equivalent in C++ if so, then where is it defined ?</p>