title: how to set precision without header file without iomanip
body: <p>When I print the value of <code>max1</code>, I get rounded output.</p>
  
  <p>Using <code>setprecision</code> does solve my problem, but I want to solve the problem without using additional header files like <code>iomanip</code>.</p>
  
  <pre><code>int main()
  {
      long long int n, l;
  
      cin &gt;&gt; n &gt;&gt; l;
      long long int a[n];
  
      for(int i = 0; i &lt; n; i++)
           cin &gt;&gt; a[i];
  
      sort(a, a + n);
  
      double max1 = 0;
      max1 = 2*mmax(a[0] - 0, l - a[n - 1]);
      for(int i = 0; i &lt; n - 1; i++)
       {
            max1 = mmax(max1,(a[i + 1] - a[i]));
       }
      cout &lt;&lt; max1/2.0;
      //cout &lt;&lt; fixed &lt;&lt; setprecision(6) &lt;&lt; max1/2.0;
  }
  </code></pre>
  
  <p>I received output in rounded form.</p>