How to i get this snip of code to break the while loop with both "a" and "A"? cant get the OR function right. Thanks in advance for the help.
while((product = getchar()) !='a')
CodePudding user response:
If you want to break the loop when product is a or A, you need to check if product is not a and not A in your loop condition:
while((product = getchar()) !='a' && product != 'A')
