title: Confusion about array initialization in C
body: <p>In C language, if initialize an array like this:</p>
  
  <pre><code>int a[5] = {1,2};
  </code></pre>
  
  <p>then all the elements of the array that are not initialized explicitly will be initialized implicitly with zeros.</p>
  
  <p>But, if I initialize an array like this:</p>
  
  <pre><code>int a[5]={a[2]=1};
  
  printf("%d %d %d %d %d\n", a[0], a[1],a[2], a[3], a[4]);
  </code></pre>
  
  <p><strong>output:</strong></p>
  
  <pre><code>1 0 1 0 0
  </code></pre>
  
  <p>I don't understand, why does <code>a[0]</code> print <code>1</code> instead of <code>0</code>? Is it undefined behaviour?</p>
  
  <p><strong>Note:</strong> This question was asked in an interview.</p>