title: How can I distinguish between integer and character when using scanf()
body: <p>I am just using the function <code>scanf()</code>. The code is below:</p>
  
  <pre><code>scanf("%d",&amp;a);
  printf("%d",a);
  </code></pre>
  
  <p>When I input 1, it prints 1 like I want.
  But even when I input 1a, it print 1 like before.
  when a user inputs something not integer ((ex) 2.3,12ab,1 a)
  I want to show a user the warning like "input integer".</p>
  
  <p>How can I solve this problem?</p>