Function not printing after running <pre><code>*EDITED* </code></pre> <p>I fixed some issues but i'm still calling it wrong. Somehow when i don't declare with int the GetRand function more than once i get more error messages.</p> <p>What i want as a final result is to print the array i created and also print the maximum and average of the values of it (only counting every number > -1).</p> <p>I'm calling the maxavg() function wrong and i'm getting an error message "Error] expected identifier or '(' before '{' token" at the beginning of maxavg which i haven't been able to fix.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;time.h&gt; #include &lt;limits.h&gt; int GetRand(int min, int max); int maxavg(); int main () { int a[21][21], i , j, average, maximum; for (i = 0; i &lt; 21; i++) { for ( j = 0; j &lt; 21; j++) { a[i][j] = GetRand(0, 100); printf("%3d" , a[i][j]); } a[2][15] = -1; a[10][6] = -1; a[13][5] = -1; a[15][17] = -1; a[17][17] = -1; a[19][6] = -1; printf("\n"); } average = maxavg(); maximum = maxavg(); printf("average = %d \n maximum = %d", average, maximum); return 0; } // random seed int GetRand(int min, int max); int get () { int i, r; for (i = 0; i &lt; 21; i++) { r = GetRand(0, 100); printf("Your number is %d \n", r); } return(0); } int GetRand(int min, int max) { static int Init = 0; int rc; if (Init == 0) { srand(time(NULL)); Init = 1; } rc = (rand() % (max - min +1) +min); return (rc); } // max and average int maxavg(); { int max=INT_MIN, sum=0, count=0, avg, n, m, current; current = a[i][j]; avg = sum/count; for(n = 0; n &lt; 21; n++){ for(m =0; m &lt; 21; m++){ if(current &gt; -1){ sum = sum + current; count = count + 1; if(current &gt; max){ max = current; } } } } return(0); } </code></pre>