title: implicit declaration of function [-Wimplicit-function-declaration]
body: <p>I am new to programming in C and I am making a C program to find the average and percentage of marks obtained by a student in three subjects using a single function. My code is:</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  int main()
  {
      float aver, per, mark1, mark2, mark3;
      printf(&quot;Enter the marks of subject 1: &quot;);
      scanf(&quot; %f&quot;, &amp;mark1);
      printf(&quot;Enter the marks of subject 2: &quot;);
      scanf(&quot; %f&quot;, &amp;mark2);
      printf(&quot;Enter the marks of subject 3: &quot;);
      scanf(&quot; %f&quot;, &amp;mark3);
      averper(mark1, mark2, mark3, &amp;aver, &amp;per);
      printf(&quot;The average of marks entered by you = %f\n&quot;, aver);
      printf(&quot;The percentage of marks entered by you = %f&quot;, per);
      return 0;
  }
  float averper(float a, float b, float c, float *d, float *e)
  {
      float sum = a + b + c;
      *d = sum / 3;
      *e = (sum / 300) * 100;
  }
  </code></pre>
  <p>The errors obtained are:</p>
  <pre>
  main.c: In function ‘main’:
  main.c:11:2: warning: implicit declaration of function ‘averper’ [-Wimplicit-function-declaration]
    averper(mark1, mark2, mark3, &aver, &per);
    ^~~~~~~
  main.c: At top level:
  main.c:16:7: error: conflicting types for ‘averper’
   float averper(float a, float b, float c, float *d, float *e)
         ^~~~~~~
  main.c:11:2: note: previous implicit declaration of ‘averper’ was here
    averper(mark1, mark2, mark3, &aver, &per);
    ^~~~~~~ 
  </pre>
  <p>Thanks</p>