#include using namespace std; int main() { int n; cout << "The number of elements" << endl; cin >> n; cout << "Enter the array" << endl; int a[100]; int sum = 0; // Declaration of sum variable for(int i = 0; i < n; ++i){ cin >> a[i]; sum += a[i]; } cout << "The sum is " << sum << endl; float avg = float(sum) / n; cout << "The average is " << avg << endl; return 0; }