And to clarify that, because the word "or" in English is horribly ambiguous, the expression "a || b" evaluates to true if one, or both, of a and b are true. (And therefore, to false if both of them are false.)
OK so in example given below, if(a || b || c) command gets executed only if one of a, b or c is equal to true; even if boolean a=false, boolean b=false and boolean c=false is before if(a || b || c) conditions???
boolean a=false;
boolean b=false;
boolean c=false;
if (a || b || c)
{
statements;
}
Have you tried it?
Do some working out with a pencil and paper and see whether any of the combinations of p q and r with the [inclusive]OR operator evaluate to true. You may find the easiest way to do that is to draw a truth table.
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad: