Skip to content

Instantly share code, notes, and snippets.

@jgrahamc
Created April 13, 2020 17:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgrahamc/9a90399f39926857b19e8635b30a3ebd to your computer and use it in GitHub Desktop.
Save jgrahamc/9a90399f39926857b19e8635b30a3ebd to your computer and use it in GitHub Desktop.
COBOL code appearing in The Terminator (1984)
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