For the Enter Option function. I have given the user 12 choices to choose from. If not entered, it will ask the user to enter it again. Once completed, the int Enteroption function will return number;. On void print_divisible(int divisiblenumber)I will get my results of some the choices. Note: I will have more functions later on related to print_divisible I'm making another function now
void SelectSeries (int &number)
which requires me to use reference parameter. Suppose the user wants choice 3 which will require print_divisible[/code] to be used. If user enters 3 Enter Option I want to use that in this select series code. Can anyone help me out with this...and give me a hint of how to do it.
//Void function for promting the user to enter a choice
int EnterOption()
{
int number;
cout<< "\n\nEnter Option: ";
cin>>number;
//if the user enters the wrong number, it will ask again
while (number <0 || number >12)
{
cout<<"\n\nEnter Valid Option: ";
cin>>number;
}
return number;
void print_divisible(int divisiblenumber)
{
int remainder;
int counter=1;
while (counter<=100)
{
remainder=counter%divisiblenumber;
if (remainder==0)
{
cout<<counter;
}
counter++;
}
}
}
void SelectSeries (int &number)