When inverting all your logic with "!" you did the right thing by changing the conditional statements "==" to "! =", but you forgot to change the logical operators "||" on the "& &". So this should be correct:
while (ch!='q' && ch!='Q');
I am using C #, therefore, while the code above will work, I would use this instead, since it is easier to read:
while (ch.ToUpper() != 'Q');
source
share