title: Loop terminates after fourth iteration
body: <p>This is my code</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cmath&gt;
  using namespace std;
  #define ll long long
  int main()
  {
      ll int a;cin&gt;&gt;a;
      ll int i=1;
      ll int arr[i];
      while(a)
      {
          arr[i-1]=a%10;
          a/=10;
          i++;
          cout&lt;&lt;a&lt;&lt;" ";
      }
      i--;
      cout&lt;&lt;endl;
      cout&lt;&lt;i&lt;&lt;endl;
  }
  </code></pre>
  
  <p>And I get the output as</p>
  
  <pre><code>&gt;12345 1234 123 0 
  &gt;4
  </code></pre>
  
  <p>for input: </p>
  
  <pre><code>123456
  </code></pre>
  
  <p>The loop terminates after fourth iteration, even when the while condition is not satisfied. Can anyone guide me?</p>