title: Why do I get string of seemingly random number from this code?
body: <pre><code>#include &lt;stdio.h&gt;
  
  #define LIM 1
  
  int main(int argc, char const *argv[]) {
    int i;
    int c;
    char s[LIM];
  
    for (i=0; i &lt; LIM-1 &amp;&amp; (c=getchar()) != '\n' &amp;&amp; c != EOF; ++i)
    {
      s[i] = c;
    }
    printf("%d\n", s);
    return 0;
  }
  </code></pre>
  
  <p>The output is for instance: 1541348039 
  I am expecting it to be 1.</p>