So, what's the answer you're looking for help explaining?
I'll assume it's the output of the program.
Then, which part of the program are you looking for help explaining?
I'll assume it's the compound boolean conditions used in the two if statements.
You can think of the AND operators as binding operands more tightly than the associated OR operators. In other words, the AND operators are evaluated before the OR operators.
If it helps you, you could add parentheses to the expression to help clarify the order that things are evaluated.
So, for the first if statement, you could think of
b1 & b2 | b2 & b3 | b2 as
(b1 & b2) | (b2 & b3) | b2, and then hopefully it becomes clear that the expression evaluates to FALSE OR FALSE OR FALSE, which is FALSE, and so "ok " is not displayed to the console.
Is the evaluation of the second if statement any clearer?
Now, back on the subject of asking a good question. When asking folks a question, taking a minute to first explain things to your
Cardboard Analyst and to think about
Asking a Good Question is time well spent.