title: scanf("%c") call seems to be skipped
body: <p>I tried this code below, but it seems <code>scanf(&quot;%c&quot;)</code> is skipped. It only asks me to enter name and age and skips the lines below that. It just print the text in the <code>printf</code> above the <code>if</code> statements. Can anyone help?</p>
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
      int age;
      char sex;
      char name[20];
      char status;
      printf(&quot;Enter your last name\n&quot;);
      scanf(&quot;%s&quot;, &amp;name);
  
      printf(&quot;Enter your age\n&quot;);
      scanf(&quot;%d&quot;, &amp;age);
  
      printf(&quot;Enter sex (M/F)\n&quot;);
      scanf(&quot;%c&quot;, &amp;sex);
  
      printf(&quot;your status,married, single,irrelevant (M/S/I)\n&quot;);
      scanf(&quot;%c&quot;, &amp;status);
      if(age&gt;=16 &amp;&amp; sex=='M')
          printf(&quot;hello, Mr %s\n&quot;, name);
      if(age&lt;16 &amp;&amp; sex =='M')
          printf(&quot;hello, Master %s\n&quot;, name);
      if(sex=='F' &amp;&amp; status=='M')
          printf(&quot;hello, Mrs %s\n&quot;, name);
      if(sex=='F' &amp;&amp;(status=='S' ||status=='I'))
          printf(&quot;hello,miss %s\n&quot;, name);
  }
  </code></pre>