Well which of the followinf is correct for the below statement and why
i want to make sure that the user does not enter the key a b c and d. In case he enters these he should get an error messgae
if(input!='a' && input!='b' && input!='c' && input!='d')
cour<<"Error";
OR
if(input!='a' || input!='b' || input!='c' || input!='d')
cour<<"Error";
well logicaly the furst one seems to be correct saying that if the user enters A or B or C or D give the error message.. But this statement does not work.. The second statement works...
I know it is got to do with the OR gate and AND gates.. But please clarify