Please read the guide .
Please answer the question in detail
#include <iostream> using namespace std; int main() { int numArray[10]; int sum = 0; double avg; // Input numbers into array for (int i = 0; i < 10; i++) { cout << "Enter number " << i+1 << ": "; cin >> numArray[i]; sum += numArray[i]; } // Calculate average avg = static_cast<double>(sum) / 10; // Print sum and average cout << "Sum of array elements = " << sum << endl; cout << "Average of array elements = " << avg << endl; return 0; }
Doubtly is an online community for engineering students, offering:
Get the pro version for free by logging in!
5.7k questions
5.1k answers
108 comments
559 users