'do while' loop

Hey! i need an advice about this little/stupid problem:

#include <iostream>
#include <cmath>

int main()
{
using namespace std;
char answer;
do
{
cout << "do you think that Angelina is hot? y/n" << endl;
cin >> answer;
if ( answer == 'y' || answer == 'Y')
cout << "you sick perv" << endl;
else if ( answer == 'n' || answer == 'N')
cout << "on, youre fine" << endl;
else
cout << "answer the question correctly you dumb idiot" << endl;
}
while ( answer != 'y' || answer != 'Y' || answer != 'n' || answer != 'N' ||);

system("pause");
return 0;
}

The bold line won't work correctly, at least not as intended, it never ends :)
answer != 'N' ||);

That aside, you need the entire statement to be false when any one of these is false. Maybe you should use ANDs instead of ORs?

-Albatross
oh yess! there are those ANDs :) thanks!

i guess this was a bit embarrassing even for beginner...
Topic archived. No new replies allowed.