cobol add more than 2 numbers

Program to ADD more than two numbers

IDENTIFICATION DIVISION.
PROGRAM-ID. PGM10.
AUTHOR. Indus Computer Services.
*ADD MORE THAN TWO NUMBERS
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 A PIC 9(2) VALUE 12.
77 B PIC 9(2) VALUE 12.
77 C PIC 9(2) VALUE 12.
77 D PIC 9(2) VALUE 12.
PROCEDURE DIVISION.

ADD A B C TO D.
DISPLAY 'D = A + B + C +D ' D.
STOP RUN.

0 comments:

Post a Comment