What is wrong with my int function? I'm trying to do a while loop but whenever ido it, it gives me an error saying "While expected before." I'm getting an error on the last parenthis of this function.
//Function will prompt the user to enter the option they want the computer to read
int EnterOption()
{
//Tell use to enter in a choice
cout<<"Enter Choice\n";
//Display all the choices
//The counter is set to 1. Printing out the text in a quicker way. Displaying text on screen.
int counter=1;
while(counter<=9)
{
cout<<"\n\n\t" <<counter<< ".] Print all the numbers between 1 and 1000 that are divisible by "<< counter;
counter++;
}
//Display the other three options
cout<<"\n\n\t10.] Print all the numbers between one and thousand";
cout<<"\n\n\t11.] Print all the even numbers between one and thousand";
cout<<"\n\n\t12.] Print all the odd numbers between one and thousand";
do
{
cout<<"Enter Choice: ";
}
}
//Function will
do
{
//stuff to be repeated
} while( condition is true );
Also I seem to notice you call all of your functions by the return type. A function returning void is still a function a function returning an int is still a function. Also , please check out this tutorial on control structures. http://www.cplusplus.com/doc/tutorial/control/