title: Whitespace before %c specification in the format specifier of scanf function in C
body: <p>When I don't include white space between <code>%d</code> and <code>%c</code> specification in the format string of <code>scanf()</code> function in the following program, and give input during run-time as "4 h", then the output is "Integer = 4 and Character= .</p>
  
  <p>How exactly variable <code>"c"</code> takes the input in this case and what difference does it make if i include a white space between <code>%d</code> and <code>%c</code> specification ?</p>
  
  <p><strong><em>Code</em></strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      char c;
      int i;
      printf("Enter an Integer and a character:\n");
      scanf("%d %c",&amp;i,&amp;c);
      printf("Integer = %d and Character = %c\n",i,c);
      getch();
  } 
  </code></pre>