Answers for "compute the average of an array c++"

C++
0

compute the average of an array c++

double computeAverage(int a[], double length){
    double total = 0;
    for(int i = 0; i < length; i++) {
        total += a[i];
    }
    return total / length;
}
Posted by: Guest on February-11-2022

Code answers related to "compute the average of an array c++"

Browse Popular Code Answers by Language