Complier Error on void

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  //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 
I know I'm suppose to add while after do, but im getting still getting an error on the last parenthesis
I think it might be the misuse of the do/while loop. You have the do(line 21) but no while(line 24.)
it should look like
1
2
3
4
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/
when all is said and done... your int function needs to return an int. If you want no value returned then make it a void function.
I got my solution now :) Thanks guys :)
Topic archived. No new replies allowed.