I have a piece of code here :
printf("Enter only parenthesis to arr or anything else to exit\n");
scanf(" %c", &data);
if (data != '(' || data != ')' || data != '[' ||
data != ']' || data != '{' || data != '}')
{
printf("\nExit scanning \n");
return;
}
My problem that no matter what i do when I enter any parenthesis it enters the "if" condition. I also tried getchar() but nothing worked either. Can you tell what's wrong I can't understand