Ответ:
#include <iostream>
using namespace std;
int main()
{
int arr[10];
int sum = 0;
double avrg = 0;
for (int i = 0; i < 10; i++)
cout << "Enter an element: ";
cin >> arr[i];
sum += arr[i];
}
avrg = (double)sum / 10;
cout << "The average of all elements is: " << avrg << endl;
return 0;
Объяснение:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Ответ:
#include <iostream>
using namespace std;
int main()
{
int arr[10];
int sum = 0;
double avrg = 0;
for (int i = 0; i < 10; i++)
{
cout << "Enter an element: ";
cin >> arr[i];
sum += arr[i];
}
avrg = (double)sum / 10;
cout << "The average of all elements is: " << avrg << endl;
return 0;
}
Объяснение: