I am trying to find the average for the 10 different integer input from user and then to fine numbers above the average and below the average, I dont know what is wrong the code below executes and i am able to input 10 different integer but after that the program exits I am not able to see what it executes can anyone help within this.
#include <iostream>
using namespace std;
void numav(int *arg);
int main()
{
int *array = new int[10];
for(int i=0; i<10; i++)
{
cout<<"Enter number "<<(i+1)<<endl;
cin>>array;
}
numav(array);
return 0;
system("PAUSE");
return EXIT_SUCCESS;
}
void numav(int *arg)
{
float x = 0;
int y = 0;
for(int i=0;i < 10; i++)
{
x +=arg;
}
x /=10;
for(int i=0;i < 10; i++)
{
if (x<arg)
y++;
}
cout<<endl<<"The average is:"<<x<<endl<<"The number above the average is:"<<y;
}