ok, i want a program to average, but it wont work. tell me whats wrong.
void avg (void)
{
cout<<"This program will get the average of numbers you enter."<<endl;
float g, x, y, num, avg, num1;
cout<<"How many numbers do you want to enter? ";
cin>>num1;
num=num1;
do
{
cout<<"Please enter your numbers: ";
cin>>x;
num=num-1;
avg=avg+x;
}while(num>0);
g=avg/num1;
cout<<"The average of your numbers is: "<<g<<flush<<endl;
_getch();
}