title: i think theres something wrong with this array but i dont know what?
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  
  
  int main() {
      int n;
      scanf(&quot;%d&quot;,&amp; n );
      int array[n];
      scanf(&quot;\n%d&quot;,array );
      int i;
      for( i=0;i&lt;=n;i++)
      if(array[i]&gt;array[i-1]&amp;&amp;array[i]&gt;array[i+1]){
          printf(&quot;\n%d&quot;,array[i]);
      }
      
      return 0;
  }
  </code></pre>
  <p>The input is both the size and the elements of the array, the program should print the elements that are larger from its neighbors (the elements in right and left side of it)</p>
  <p>input: 5 (size of the array)<br />
  2 4 3 2 1 (the elements of the array)</p>
  <p>output: 4 (is larger from 2 and 3)</p>