title: Why does this loop execute only 4 times?
body: <p>I am beginner in c programming.I just want to know why this loop is not working properly.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int i;
      char x[8];
      char t;
  
      for (i = 0; i &lt; 8; i++) {
          scanf("%c", &amp;t);
          x[i] = t;
      }
      return 0;
  }
  </code></pre>