title: Why this "Implicit declaration of function 'X'"?
body: <p>I wrote a simple program to find the Sum, average, biggest and smallest number of 3 numbers.
  It lets the user to input three (integer) numbers and return the sum, average, max and min.
  It has no errors but a warning. Here is my source code:</p>
  
  <p>main.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int num1, num2, num3, sum, max, min, avg;
  
      printf("Enter Three \"Integer\" Numbers:");
  
      scanf("%i%i%i", &amp;num1, &amp;num2, &amp;num3);
  
      sum = summation(&amp;num1, &amp;num2, &amp;num3);
      avg = average(&amp;sum);
      max = max_val(&amp;num1, &amp;num2, &amp;num3);
      min = min_val(&amp;num1, &amp;num2, &amp;num3);
  
      printf("Sum: %i Avg: %i MAX: %i MIN: %i", sum, avg, max, min);
  
      return 0;
  }
  
  int summation(int *n1, int *n2, int *n3)
  {
      int s;
      s = *n1 + *n2 + *n3;
  
      return s;
  }
  
  int average(int *s)
  {
      int a;
      a = *s / 3;
  
      return a;
  }
  
  int max_val(int *n1, int *n2, int *n3)
  {
      int MAX;
  
      if (*n1 &gt; *n2) MAX = *n1;
      else if (*n2 &gt; *n3) MAX = *n2;
      else MAX = *n3;
  
      return MAX;
  }
  
  int min_val(int *n1, int *n2, int *n3)
  {
      int MIN;
  
      if (*n1 &lt; *n2) MIN = *n1;
      else if (*n2 &lt; *n3) MIN = *n2;
      else MIN = *n3;
  
      return MIN;
  }
  </code></pre>
  
  <p>I think there is no need to make a header file because all functions are in type of "int".</p>
  
  <p>When I compile this</p>
  
  <pre><code>gcc main.c -o test
  </code></pre>
  
  <p>It says</p>
  
  <pre><code>main.c: In function 'main':
  main.c:34:5: warning: implicit declaration of function 'summation' [-Wimplicit-function-declaration]
  </code></pre>
  
  <p>Why this warning? I can't find any wrong in that declaration.
  What's that?</p>