title: Why scanf not working for double and float?
body: <p>CODE 1 (above)</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdio&gt;
  using namespace std;
  
  int main() {
      int a; 
      long long int b; 
      char c; 
      float d; 
      double e;
      scanf(&quot;%i %lli %ch %f %d&quot;, &amp;a, &amp;b , &amp;c, &amp;d, &amp;e);
      printf(&quot;%i\n%lli\n%ch\n%f\n%d&quot;, a,b,c,d,e);
  
      return 0;
  }
  </code></pre>
  <p>CODE 2 (BELOW)</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdio&gt;
  using namespace std;
  
  int main() 
  {
      // Complete the code.
   int a;
   long long int b;
   char c;
   float d;
   double e;
  
   scanf(&quot;%d %lld %c %f %lf&quot;,&amp;a,&amp;b,&amp;c,&amp;d,&amp;e);
      
   printf(&quot;%d\n%lld\n%c\n%f\n%lf&quot;,a,b,c,d,e);
  
  return 0;
  }
  </code></pre>
  <p>why the code(top one) is not asking for input afterward float (it is not asking for the values of float and double, while the code below is correct and taking all inputs</p>