title: format specifier for double in scanf
body: <p>I wrote this program for getting a double input:</p>
  
  <pre><code>double n;
  scanf("%lf",&amp;n);
  while(fgetc(stdin)!='\n')
      return 0;
  printf("%lf",n);
  </code></pre>
  
  <p>This program is supposed to take double as input. Provided that <code>%lf</code> is the format specifier for <code>double</code> in <strong><code>scanf</code></strong>, I used it. But for inputs of a digit followed by e. ex.(3e), the input is being read without errors. But during processing of the same variable, it is discarding the <code>e</code> and only considering <code>3</code> as is shown by the <code>printf</code> statement. What is the cause of such behaviour?</p>