title: Why declaring the size of an array as n, before inputting n, works for the first time but not the second time?
body: <p>I was solving a problem, and I declared the size of an array as n, before inputting n's value and it worked for the first test case but not for the second test case. Why?</p>
  
  <blockquote>
    <p>P.S: I couldn't find any relevant information online.</p>
  </blockquote>
  
  <p>Here is the code snippet</p>
  
  <pre><code>    int n,arr[n];
      cin&gt;&gt;n;
  </code></pre>