Name: Anonymous 2011-04-03 19:21
using namespace std;
for (int k=0;k<N; k++) //summation
{
sum=sum+y[k];
}
y_ave= sum/N;
// Count elements greater than average
for (int k=0;k<N; k++) //counting!
{
if (y[k] >y_ave)
count++;
}
cout<<“The sum of elements in the array”<<sum<<endl;
cout<< count<< “ values are greater than average value”<< y_ave<<endl;
for (int k=0;k<N; k++) //summation
{
sum=sum+y[k];
}
y_ave= sum/N;
// Count elements greater than average
for (int k=0;k<N; k++) //counting!
{
if (y[k] >y_ave)
count++;
}
cout<<“The sum of elements in the array”<<sum<<endl;
cout<< count<< “ values are greater than average value”<< y_ave<<endl;