forked from alura-cursos/cursoopencobol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aplicando-soma.cbl
35 lines (31 loc) · 1.17 KB
/
aplicando-soma.cbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
IDENTIFICATION DIVISION.
PROGRAM-ID. PRGCOB05.
******************************************************
*** AREA DE COMENTARIOS - REMARKS
*** OBJETIVO DO PROGRAMA = OPERACOES ARITMETICAS
*** AUTOR: IVAN
*** DATA : XX/XX/20XX
******************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 WRK-NUM1 PIC 9(02) VALUE ZEROS.
77 WRK-NUM2 PIC 9(02) VALUE ZEROS.
77 WRK-RESUL PIC 9(04) VALUE ZEROS.
PROCEDURE DIVISION.
DISPLAY 'ENTRE COM O PRIMEIRO OPERANDO: '
WITH NO ADVANCING
ACCEPT WRK-NUM1
DISPLAY 'ENTRE COM O SEGUNDO OPERANDO: '
WITH NO ADVANCING
ACCEPT WRK-NUM2
DISPLAY '====================================='
DISPLAY 'NUMERO 1. : ' WRK-NUM1
DISPLAY 'NUMERO 2. : ' WRK-NUM2
ADD WRK-NUM2 WRK-NUM1 TO WRK-RESUL
DISPLAY '== OPERACAO SOMA ======' WRK-RESUL
STOP RUN
.