while loop

okay this is supposed to be a super simple loop that I had put in my program as a validation but for some reason it dosent seem to work its probably something small but ive been stuck on this for some reason

1
2
3
4
5
6
7
8
9
10
11
  char choice ;
  cin >> choice;
		while (choice != 'A' || choice != 'B' || choice != 'C' || choice != 'D' || choice != 'E' || choice != 'F')
		{
			cout << " You did not enter a correct choice " << endl;
			cout << "retry " << endl;
			cin >> choice;

		}

cout << "works";



for some reason when i enter a proper char like A it dosent get out of the loop it just keeps looping again and again no matter what I input
Last edited on
(choice != 'A' || choice != 'B')
This statement will always be true. Try to evaluate it yourself.
(You want &&)
ohh okay I get it now makes sense idk why i put "or" for some reason


thank u
Topic archived. No new replies allowed.