MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / main

Function main

Lab_08/average.cpp:4–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2using namespace std;
3
4int 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected