Programação
Por: uallace • 20/4/2015 • Monografia • 1.556 Palavras (7 Páginas) • 123 Visualizações
*--------------------------------------------------------- 00010000
* PROGRAMA PARA CALCULAR A SOMATORIA DOS NUMEROS PARES 00020000
*--------------------------------------------------------- 00030000
IDENTIFICATION DIVISION. 00040000
PROGRAM-ID. PRG0101. 00050000
*--------------------------------------------------------- 00060000
ENVIRONMENT DIVISION. 00070000
CONFIGURATION SECTION. 00080000
SPECIAL-NAMES. 00090000
DECIMAL-POINT IS COMMA. 00100003
*--------------------------------------------------------- 00110000
DATA DIVISION. 00120000
WORKING-STORAGE SECTION. 00130000
77 WK-SOMA PIC S9(05) COMP-3 VALUE ZEROS. 00140000
77 WK-Y PIC 9(02) VALUE ZEROS. 00150004
77 WK-Z PIC 9(02) VALUE ZEROS. 00160004
77 WK-CONT PIC S9(04) COMP VALUE ZEROS. 00170000
01 WK-NUMEROS PIC X(20) VALUE '01020304050607080900'. 00180000
01 TB-NUMEROS REDEFINES WK-NUMEROS. 00190000
05 TB-NUM PIC 9(02) OCCURS 10 TIMES. 00200004
*--------------------------------------------------------- 00210000
PROCEDURE DIVISION. 00220000
000-00-INICIO. 00230000
MOVE 1 TO WK-CONT 00240000
00250000
PERFORM UNTIL WK-CONT GREATER 10 00260000
COMPUTE WK-Y = TB-NUM(WK-CONT) / 2 00270000
COMPUTE WK-Z = WK-Y * 2 00280000
IF WK-Z = TB-NUM(WK-CONT) 00290000
COMPUTE WK-SOMA
...