title: What is the effect of trailing white space in a scanf() format string?
body: <p>What is difference between <code>scanf("%d")</code> and <code>scanf("%d ")</code> in this code, where the difference is the trailing blank in the format string?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void)
  {
      int i, j;
  
      printf("enter a value for j ");
      scanf("%d  ",&amp;j);
      printf("j is %d\n", j);
      printf("enter a value for i ");
      scanf("%d", &amp;i);
      printf("i is %d\n", i);
      return 0;
  }
  </code></pre>
  
  <p>How does the <code>scanf()</code> function actually work when I add spaces after the format specifier like <code>scanf("%d  ", &amp;j);</code>?</p>