title: why this code works in C
body: <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
  
  char array[2];
  array[0] = 'q';
  array[1] = 'a';
  printf("%s",array);
  
  return 0;
  }
  </code></pre>
  
  <p>if you ask me this code should not work. printf prints array[2] like string but it's not a string. When i execute it, it works perfectly. Can you explain why?</p>