I am trying to get the user to enter one of four letters, either D, B, A, or O. Then I am using an if statement to check if the user entered an invalid letter. If the user enters one of the four letters above, then nothing should happen. If they enter something else, then it should ask them to "enter a valid letter". I tried to code this, and the problem is no matter what I enter it pops up with "enter a valid letter". Can anyone tell me what I'm doing wrong? here is my code..
Code:
int main() {
char letter;
printf("\n\nEnter a letter ('D','A','B',or 'O'): ");
scanf("%c", &letter);
if (letter != 'D' || letter != 'A' || letter != 'B' || letter != 'O') {
printf("Please enter a valid letter: \n");
scanf("%c", &letter);
}
}