Jeanne Boyarsky wrote:And don't worry. The daft ones are quietly confused and not learning. You are smart for asking!
And the very smart ones, use each code snippet to do some experimenting and twiddling to learn even more
So let's give you a hand and create a bunch of examples with some minor changes to the original code snippet. And the question each time is the same: what's the output? Will it be different than the original one? Here we go!
Example 1: use bitwise
& operator
Example 2: use postfix increment operator in condition expression
Example 3: use prefix increment operator in condition expression
Example 4: use conditional
|| operator and prefix increment operator
Example 5: use bitwise
| operator (and prefix increment operator)
Example 6: use conditional
|| operator and postfix increment operator
Example 7: use bitwise
| operator (and postfix increment operator)
So much fun with such a small code snippet!
Hope it helps!
Kind regards,
Roel