PxPlus User Forum
Main Board => Discussions => Programming => Topic started by: Thomas Bock on October 16, 2019, 09:45:34 AM
-
In my opinion the following condition should print a star
if 1 or 0 and 0 then print "*"
It is the same as
if 1 or (0 and 0) then print "*"
or
1+0*0
For better understanding we will add the brackets.
PxPlus doesn't print a star. I'm curious, what am I missing?
-
The 'AND' and 'OR' operators have the same precedence level, so they are evaluated left-to-right. In this case, it essentially works out to be:
if (1 or 0) and 0 then print "*"