Created
April 13, 2020 17:10
-
-
Save jgrahamc/9a90399f39926857b19e8635b30a3ebd to your computer and use it in GitHub Desktop.
COBOL code appearing in The Terminator (1984)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDENTIFICATION DIVISION. | |
PROGRAM-ID. ADD. | |
ENVIRONMENT DIVISION. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
77 IDX PICTURE 9999. | |
77 SUMX PICTURE 999999. | |
77 X PICTURE X. | |
PROCEDURE DIVISION. | |
BEGIN. | |
ACCEPT X. | |
MOVE ZERO TO IDX. | |
MOVE ZERO TO SUMX. | |
PERFORM ADD-PAR UNTIL IDX = 1001. | |
DISPLAY SUMX. | |
STOP RUN. | |
ADD-PAR. | |
COMPUTE SUMX = SUMX + IDX. | |
ADD 1 TO IDX. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment