#include <iostream>
using namespace std;
void main()
{
intA[10]={10,22,3,44,5,55,34,4,43,4};
int length= 10;
int sum =0;
int avg =0;
for(int i =0; i < length; i++)
{
sum+= A[i];
}
avg = sum /length;
cout<< "Sum: " << sum << endl;
cout<< "Average: " << avg << endl;
}
Comments
Leave a comment