Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
5
Task/Logical-operations/BASIC/logical-operations.basic
Normal file
5
Task/Logical-operations/BASIC/logical-operations.basic
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
SUB logic (a%, b%) 'no booleans in BASIC...these are integers. 1 for true 0 for false.
|
||||
PRINT a AND b
|
||||
PRINT a OR b
|
||||
PRINT NOT a
|
||||
END SUB
|
||||
26
Task/Logical-operations/COBOL/logical-operations.cobol
Normal file
26
Task/Logical-operations/COBOL/logical-operations.cobol
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. print-logic.
|
||||
|
||||
DATA DIVISION.
|
||||
LOCAL-STORAGE SECTION.
|
||||
01 result PIC 1 USAGE BIT.
|
||||
|
||||
LINKAGE SECTION.
|
||||
01 a PIC 1 USAGE BIT.
|
||||
01 b PIC 1 USAGE BIT.
|
||||
|
||||
PROCEDURE DIVISION USING a, b.
|
||||
COMPUTE result = a B-AND b
|
||||
DISPLAY "a and b is " result
|
||||
|
||||
COMPUTE result = a B-OR b
|
||||
DISPLAY "a or b is " result
|
||||
|
||||
COMPUTE result = B-NOT a
|
||||
DISPLAY "Not a is " result
|
||||
|
||||
COMPUTE result = a B-XOR b
|
||||
DISPLAY "a exclusive-or b is " result
|
||||
|
||||
GOBACK
|
||||
.
|
||||
Loading…
Add table
Add a link
Reference in a new issue