Cant find what the error in my code is

This is supposed to be a basic game where you guess a number and the comp will tell you if you got it right or not.
I have the entire thing written, but i cannot run it!
I keep getting this:

error C2059: syntax error : '}'

Its basically saying that im missing a bracket.
I cant seem to find where the thing is though! as far as i can tell, every bracket is paired.

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
#include <stdlib.h> 
#include <iostream>
using namespace std;

int main(){

	int shell, guess;
	int number = rand()%3 + 1;
	char choice;

	do{
		cout << "Would you like to play the shell game? Press 'y' for yes and 'n' for no." << endl;

			if (choice == 'y'){
				cout << "Where is the nut? Under Shell 1, Shell 2, or Shell 3? (Only type in number of shell)";
					while (guess != number){
						if (guess > number) {
							cout << "Wrong one, try again.";
						}else{ cout << "Wrong one, try again.";
						}

	}while (choice !='n');
	cout << "Press any key then enter. Goodbye!";
	cin >> choice;

	return 0;

	}
	} 
}


Anyone care to take a look and tell me where im missing the bracket?
thanks in advance.
On line 21 you (I assume) are missing a closing brace for your while(guess != number) loop. You have two extra brackets on lines 28 and 29.
Topic archived. No new replies allowed.