#include<stdio.h>
int main ()
{
char x;
printf(“Input a letter:”);
scanf(“%c”,&x);
while(x!=‘y’ || x!=‘Y’ || x!=’n’ || x!=’N’)
{
printf(“Input a letter:”);
scanf(“%c”,&x);
}
printf(“The input is valid”);
return 0;
}
I cant find my mistake, but the output keeps on showing double "Input a Letter"
Last edited on
Hi,
Try && instead of ||
while(x != ‘y’ && x != ‘Y’ && x != ’n’ && x !=’N’)