title: char Input in C by scanf
body: <p>Help me Please.
  I want to know why it happen.</p>
  
  <p>This code is not give right answer:</p>
  
  <pre><code>#include &lt; stdio.h&gt;
  
  int main()
  
  {
  
    char c,ch;
  
    int i;
  
      printf("Welcome buddy!\n\nPlease input first character of your name: ");
      scanf("%c",&amp;c);
  
      printf("\nPlease input first character of your lovers name: ");
      scanf("%c",&amp;ch);
  
      printf("\nHow many children do you want? ");
      scanf("%d",&amp;i);
  
      printf("\n\n%c loves %c and %c want %d children",c,ch,c,i);
  
    return 0;
  }
  </code></pre>
  
  <hr>
  
  <p>but this code give right answer.</p>
  
  <pre><code>#include &lt; stdio.h&gt;
  
  int main()
  {
    char c,ch;
    int i;
  
      printf("Welcome buddy!\n\nPlease input first character of your name: ");
      scanf(" %c",&amp;c);
  
      printf("\nPlease input first character of your lovers name: ");
      scanf(" %c",&amp;ch);
  
      printf("\nHow many children do you want? ");
      scanf("%d",&amp;i);
  
      printf("\n\n%c loves %c and %c want %d children",c,ch,c,i);
  
    return 0;
  }
  </code></pre>
  
  <hr>
  
  <p>Why?
  and How?</p>
  
  <p>Please help me anyone who know this why it happend.</p>