title: Character input in scanf("%d", &value)
body: <p>In brief my code is,</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      int n;
      scanf("%d", &amp;n);
      while(n != 0)
      {
          scanf("%d", &amp;n);
          printf("%d\n", n);
      }
      return 0;
  }
  </code></pre>
  
  <p>It was written for <code>integer</code> input. But if I input a <code>character</code> instead (although n is decleared as <code>integer</code>), the loop goes infinite and prints the last <code>integer</code> input value. If I input a <code>character</code> at first it seems like it prints a memory address. My question is, what is happening here if I input a <code>character</code> instead an <code>integer</code>?</p>