Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Sum values in an array of numbers.
IDENTIFICATION DIVISION.
PROGRAM-ID. SUM-TABLE.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUMBERS.
05 NUM PIC 9(3) OCCURS 5 TIMES VALUE 10.
01 TOTAL PIC 9(5) VALUE 0.
01 I PIC 9 VALUE 1.
PROCEDURE DIVISION.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 5
ADD NUM(I) TO TOTAL
END-PERFORM.
DISPLAY 'Total Sum: ' TOTAL.
STOP RUN.COBOL Variants refer to the different dialects and implementations of COBOL (Common Business-Oriented Language), a legacy programming language widely used in business, finance, and administrative systems.
Origin & Creator
Developed in 1959 by a consortium including CODASYL and led by Grace Hopper to provide a standardized business programming language.
Industrial Note
Extensively used in banking, insurance, government payroll systems, and mainframe applications where decades-old COBOL systems still operate mission-critical workloads.