title: scanf("%d") works correctly with character
body: <p>The code is:  </p>
  
  <pre><code>int main() {
      scanf("%d");
      puts("hello!");
      getch();
      return 0;
  }  
  </code></pre>
  
  <p>If I input a number like <strong>7</strong>, the program crashes but if I input a character like <strong>h</strong>, the program executes successfully.  </p>
  
  <p>Could you please explain me the reason behind it?<br>
  I am using MinGW on Windows XP.</p>