title: Function not returning result in c (in a project file)
body: <p>When I run this code in a .c file, it works, but when I make a project for it, the function I call will only return 0.00. Why? Why does it not work in a project file?</p>
  
  <p>I'm using DevC++.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  float mean(int total, int max);
  
  int main(){
      int i,max, total=0;
      int array[max];
      printf("Enter max: ");
      scanf("%d",&amp;max);
  
      for(i=0; i&lt;max; i++){
          scanf("%d",&amp;array[i]);
          total+=array[i];
      }
      printf("Total: %d\n",total);
      printf("Mean: %.2f",mean(total,max));
      return 0;
  }
  
  float mean(int total, int max){
      float ave;
      ave=(float)total/max;
  
      return ave;
  }
  </code></pre>