title: scanf() is not waiting for user input
body: <p>I am working on making tree using doubly linked list in c.
  I use recursive call in that function , but somehow it do not works.
  my code is :</p>
  
  <pre><code>struct node
  {
      int data;
      struct node *right;
      struct node *left;
  };
  
  struct node* getNode()
  {
      struct node *temp;
      temp= (struct node *)malloc(sizeof(struct node));
      temp-&gt;right=NULL;
      temp-&gt;left=NULL;
      return temp; 
  }
  </code></pre>
  
  <p>here in the below function I am getting the problem.</p>
  
  <pre><code>struct node* maketree()
  {
      struct node *t;
      t=getNode(); 
      int value;
      char choice1='n',choice2='n';
      printf("\nenter the value to the node");
      scanf("%d",&amp;value);
      t-&gt;data=value;
      printf("\nis there any left child??\n");
      scanf("%c",&amp;choice1);               // I think here my problem is .
      if (choice1 == 'y')
      {
          t-&gt;left=maketree();   
      }
  
      printf("\nis there any right child??\n");
      scanf("%c",&amp;choice2);
      if (choice2 == 'y' || choice2 == 'Y')
      {
          t-&gt;right=maketree();   
  
      }
      return t;
  }
  
  int main (void)
  {
      struct node *t;
      t=maketree();
      return;
  }
  </code></pre>
  
  <p>the code compiles properly , but the problem is , the code do not wait for my choice (I use <code>scanf()</code> , C should wait untill I enter the input to the terminal.)
  but the output is :</p>
  
  <pre><code>enter the value to the node4
  
  is there any left child??
  
  is there any right child??
  </code></pre>
  
  <p>please assist.</p>