Please, URGENT!!!- function counting average array element value

Please!!!
Have urgently to write this:

function with 2 parameters (1 array[6] and 1 int a).
I have to fill the array with first 6 prime numbers >=int a.

Function RETURNS average value array[1]to[6].

Only main read and writes!!!
Please, help someone!!!

THANKS!!!


You've been on these forums long enough to know this is not how things work here.

You must post the code that you wrote so far, then we help you correct it, improve it, etc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<iostream>
using namespace std;


int Average(int array_a[20], int downborder){
 int e=1;   
 
    for (int i=2; i<downborder; i++)
    {
        if (downborder%i==0)
        {    
        downborder+=1;
        }
    else{e+=1;}
    }
    return e;
}
    



int main(){
    int db=2;
    int array_m[20];

    cout<<Average(field,sm);
    system("PAUSE");
    return 0;
           }
Uhkay... if you have five numbers: a, b, c, d and e, can you tell me how you compute their average?
Topic archived. No new replies allowed.