Ok, here is my program. If you look in the menu sub routine, I have a variable called input. I want it to be recognized in the main program. Don't tell me any alternative ways, because i already know some. Only tell me how to get the variable input to be recognized in the main program. Thanks

void menu (void)
{
int input;
cout<<"Enter the number of what you want to use"<<flush<<endl;
cout<<"1. Averager"<<flush<<endl;
cout<<"2. Multiplier"<<flush<<endl;
cout<<"3. Divider"<<flush<<endl;
cout<<"4. Subtracter"<<flush<<endl;
cout<<"5. Adder"<<flush<<endl;
cout<<"6. Exit"<<flush<<endl;
cin>>input

}

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

void multiply (void)
{
int mult(int a, int b);
cout<<"This program will get the product of two numbers"<<endl;
int a, b;
cout<<"Enter the two numbers (with a space in between): "<<endl;
cin>>a>>b;
cout<<"The product of your numbers is"<<flush<<mult(a, b)<<endl;
_getch();
}

void quotient (void)
{
int divide(int q, int w);
int q, w; //Line 61
cout<<"This program divides two numbers"<<endl;
cout<<"Enter the numbers (with a space in between): ";
cin>>q>>w;
cout<<"The quotient of your two numbers is: "<<flush<<divide(q, w)<<endl;
_getch();
}

void difference (void)
{
int subtract(int e, int r);
int e, r;
cout<<"This program subtracts two numbers"<<endl;
cout<<"Enter the numbers (with a space in between): ";
cin>>e>>r;
cout<<"The difference of the numbers is: "<<subtract(e, r)<<flush<<endl;
_getch();
}

void sum (void)
{
int add(int t, int p);
int t, p;
cout<<"This program adds two numbers"<<endl;
cout<<"Enter the two numbers (with a space in between): ";
cin>>t>>p;
cout<<"The sum of the numbers is: "<<flush<<add(t, p)<<endl;
_getch();
}

int main()
{
for(input;input<6;input=0)
{
menu();
switch (input)
{
case 1:
avg();
break;
case 2:
multiply();
break;
case 3:
quotient();
break;
case 4:
difference();
break;
case 5:
sum();
break;
case 6:
return 0;
break;
}
} //loop end
}
int mult(int a, int b)
{
return a*b;
}
int divide(int q, int w)
{
return q/w;
}
int subtract(int e, int r)
{
return e-r;
}
int add(int t,int p)
{
return t+p;
}