Receive and Return the averaging with a function?
<p>I had a test, that I failed in the C language:</p>

<ol>
<li>Create 10 random numbers.  </li>
<li>Take the highest value.  </li>
<li>Take the lowest value.  </li>
<li>Make a function that will receive the two values and return the averaging number. </li>
</ol>

<p>And I have no idea how to make the 2. 3. and 4. conditions so please if anyone could give me the code and maybe a little explanation so I can study it I would be really grateful thanks.<br>
English is not my native language so sorry if it is badly written.</p>

<p>I only have the 1. condition:       </p>

<pre><code>#include &lt;stdio.h&gt; 
#include &lt;stdlib.h&gt; 
#include &lt;time.h&gt; 

int main() { 
    int a, b; 
    srand(time(NULL)); 
    for (a = 1; a &lt;= 10; a += 1) { 
        b = rand() % 10 + 1; 
        printf("%d ", b); 
    } 
    return 0; 
}
</code></pre>