title: Error in program to get the max value
body: <p>I am trying to write a program to get the maximum value but it is not working. The calculation is performed inside a function named <code>max_number</code>.</p>
  
  <p>What is the error?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int max_number(int storeX[], int i)
  {
      int max=0,x;
      for(x=0;x&lt;i;x++)
      {
          if(storeX[x]&lt;max)
          {
              max = storeX[x];
          }
          return max;
      }
      return 0;
  }
  
  int main()
  {
      int i,x,numbers,max;
      printf("how many numbers do you want to compare?\n");
      scanf("%d",&amp;i);
      int storeX[i];
      for(x=0;x&lt;i;x++)
      {
          printf("the %d number is:",x+1);
          scanf("%d",&amp;numbers);
          numbers=storeX[x];
      }
      max=max_number(storeX,i);
      printf("the max number is: %d",max);
      return 0;
  }
  </code></pre>