Logical operations: Difference between revisions
Content deleted Content added
m →{{header|REXX}}: changed fence comments and subroutine fence, changed the look of some DO loops, added a comment. -- ~~~~ |
Added BBC BASIC |
||
Line 117: | Line 117: | ||
print a xor b |
print a xor b |
||
print not a</lang> |
print not a</lang> |
||
=={{header|BBC BASIC}}== |
|||
<lang bbcbasic> PROClogic(FALSE, FALSE) |
|||
PROClogic(FALSE, TRUE) |
|||
PROClogic(TRUE, FALSE) |
|||
PROClogic(TRUE, TRUE) |
|||
END |
|||
DEF PROClogic(a%, b%) |
|||
LOCAL @% : @% = 2 : REM Column width |
|||
PRINT a% " AND " b% " = " a% AND b% TAB(20); |
|||
PRINT a% " OR " b% " = " a% OR b% TAB(40); |
|||
PRINT a% " EOR " b% " = " a% EOR b% TAB(60); |
|||
PRINT " NOT " a% " = " NOT a% |
|||
ENDPROC</lang> |
|||
Output: |
|||
<pre> |
|||
0 AND 0 = 0 0 OR 0 = 0 0 EOR 0 = 0 NOT 0 = -1 |
|||
0 AND -1 = 0 0 OR -1 = -1 0 EOR -1 = -1 NOT 0 = -1 |
|||
-1 AND 0 = 0 -1 OR 0 = -1 -1 EOR 0 = -1 NOT -1 = 0 |
|||
-1 AND -1 = -1 -1 OR -1 = -1 -1 EOR -1 = 0 NOT -1 = 0 |
|||
</pre> |
|||
=={{header|Brat}}== |
=={{header|Brat}}== |