title: Printing double variable contents
body: <p>I tried following code snippet and output is surprising me:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main()
  {
              double num;
              unsigned char ch;
  
              ch = 19;
              num = 1.0E+20 ;
              num += ch * 1.0E+18;
              printf("E18 = %lf \n",num);
              printf("E18 = %e \n",num);
  
              num = 11.0E+21 ;
              num += ch * 1.0E+19;
              printf("E19 = %lf &lt;------\n",num);
              printf("E19 = %e &lt;------\n",num);
  
              num = 11.0E+22 ;
              num += ch * 1.0E+20;
              printf("E20 = %lf\n",num);
              printf("E20 = %e\n",num);
  
              num = 11.0E+23 ;
              num += ch * 1.0E+21;
              printf("E21 = %lf\n",num);
              printf("E21 = %e\n",num);
  
              num = 11.0E+24 ;
              num += ch * 1.0E+22;
              printf("E22 = %lf &lt;------\n",num);
              printf("E22 = %e &lt;------\n",num);
      return 0;
  }
  </code></pre>
  
  <p>The output of the program:    </p>
  
  <pre><code>E18 = 119000000000000000000.000000 
  E18 = 1.190000e+20 
  E19 = 11190000000000000524288.000000 &lt;------
  E19 = 1.119000e+22 &lt;------
  E20 = 111900000000000001048576.000000
  E20 = 1.119000e+23
  E21 = 1119000000000000044040192.000000
  E21 = 1.119000e+24
  E22 = 11189999999999999366660096.000000 &lt;------
  E22 = 1.119000e+25 &lt;------
  </code></pre>
  
  <p>Why the data corrupted when printed while in exponent form its OK</p>