title: Unexpected answer in an array for find max number
body: <p>I want to find the max number in an array.
  But my code show me unexpected answer.</p>
  <p><strong>is there any wrong in my code?</strong></p>
  <p>Here's my code:</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main()
  {
  int n;
  cout&lt;&lt;&quot;Enter array size: &quot;;
  cin&gt;&gt;n;
  int a[n];
  int maximum = 0;
  maximum=a[0];
  for(int i=0; i&lt;n; i++)
  {
      cin&gt;&gt;a[i];
      if(maximum&lt;a[i])
      {
          maximum=a[i];
      }
  
  }
  
  cout&lt;&lt;&quot;Maximum number: &quot;&lt;&lt;maximum;
  return 0;
  }
  </code></pre>
  <hr />
  <pre><code>  Here my input: 
    Enter array size: 3
    4 5 6
  </code></pre>
  <hr />
  <pre><code>  Output:
    16
  </code></pre>
  <hr />
  <pre><code>  My expected output must be 6
  </code></pre>
  <p><strong>is there any wrong in my code?</strong></p>