| 2 | using namespace std; |
| 3 | |
| 4 | int main() |
| 5 | { |
| 6 | int a[10]; |
| 7 | // input the arrays |
| 8 | cout << "Input an Array Elements. " << endl; |
| 9 | for (int i = 0; i < 10; i++) |
| 10 | { |
| 11 | cout << "array element [ " << i << " ] "; |
| 12 | cin >> a[i]; |
| 13 | } |
| 14 | cout << endl; |
| 15 | double sum = 0; |
| 16 | // sum the elements of the array |
| 17 | for (int i = 0; i < 10; i++) |
| 18 | { |
| 19 | sum += a[i]; |
| 20 | } |
| 21 | double average; |
| 22 | // finding the elements of the array |
| 23 | average = sum / 10; |
| 24 | cout << "Average of array elements: " << average << endl; |
| 25 | system("pause"); |
| 26 | return 0; |
| 27 | } |
nothing calls this directly
no outgoing calls
no test coverage detected