hello friends...
In the C++ program below..there is something wrong in the While Loop. logic.What i want is that when we type
the letters --> y,Y,n or N then the program should exit.,else
it should not exit and then print as in the cout.
But the code is not working for me.it doesnt not exits even if when we enter --> y,Y,n or N.
Plss check the while loop and reply me with modifications

Thanx in advance
Prasad

Here is the code below:--

#include<iostream.h>
main()
{
char answer;
while ( (answer != 'y') || (answer != 'Y') || (answer != 'n') || (answer != 'N') ) //error checking for answer
{

cout << "Illegal character. Please enter again." ;
cin >> answer ;

} }