c++ - How to add multiple conditions in do-while loop? -
how add both string red , blue in while(). add them
while(color!="red"||"blue");.
when run code points out error, please me this.
you have 3 problems. first, need this:
while(color!="red" || color!="blue");
then remove semi-colon because otherwise you'll have hanging code block.
next, ||
wrong operator here. should , instead:
while(color!="red" && color!="blue")
if think logically, need both predicates true. or not appropriate here.