C++: IntelliSense expected while & C1075 "end of file found before the left brace at {?

Im trying to create a program with a menu and there are 3 choices 0, 1 and 2. Im pretty sure that options 1 and 2 are correct in their DO, IF and ELSE IF statements but, the error shows up in the 0 option and the program wont run. I wanted to know if anyone sees anything wrong with this part of the program?... show more Im trying to create a program with a menu and there are 3 choices 0, 1 and 2. Im pretty sure that options 1 and 2 are correct in their DO, IF and ELSE IF statements but, the error shows up in the 0 option and the program wont run. I wanted to know if anyone sees anything wrong with this part of the program?

heres part of the program that I believe has the error:

else if (menu == 0)
{
cout << "Exit Program Y/N? : ";
cin >> ans;
}

while (ans != "y" && ans != "Y")

_getch();
return 0;
}
~ <<< there is a squiggly line here under this bracket and the 2 errors that I get is
''IntelliSense :expected 'while'' and ''error C1075 end of file found before the left brace '{' how do I fix this? Someone please help.
2 answers 2