RosettaCodeData/Task/Logical-operations/Action-/logical-operations.action
2023-07-01 13:44:08 -04:00

24 lines
374 B
Text

BYTE FUNC Not(BYTE a)
IF a=0 THEN
RETURN (1)
FI
RETURN (0)
PROC Main()
BYTE a,b,res
FOR a=0 TO 1
DO
FOR b=0 TO 1
DO
res=a AND b
PrintF("%B AND %B=%B",a,b,res)
res=a OR b
PrintF("|%B OR %B=%B",a,b,res)
res=a ! b
PrintF("|%B XOR %B=%B",a,b,res)
res=Not(a)
PrintF("|NOT %B=%B%E",a,res)
OD
OD
RETURN