-
Notifications
You must be signed in to change notification settings - Fork 0
/
exm11.cbl
76 lines (62 loc) · 2.83 KB
/
exm11.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
*****************************************************************
* *
* This software have been developed under GNU GPL v3 License. *
* That means, no closed distribution of this software is *
* allowed. *
* *
* Please refer to the License text here: *
* https://www.gnu.org/licenses/gpl-3.0.txt *
* *
* For any comment, suggestion or similar, you can reach me via *
* mail on "doscar.sole@gmail.com" *
* *
*****************************************************************
ID DIVISION.
PROGRAM-ID. EXM11.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 VARIABLES.
02 OPERACION-1.
03 OP-A.
04 BASE PIC 9(09).
04 TEMPORAL PIC 9(09).
04 DIGITOS PIC 9(04).
04 RESTO PIC 9(04).
04 CONTADOR PIC 9(01).
PROCEDURE DIVISION.
MAINLINE.
DISPLAY 'INICIO DEL PROGRAMA'.
MOVE 859753164 TO BASE.
MOVE 10 TO DIGITOS.
MOVE 1 TO CONTADOR.
DISPLAY 'BASE: ' BASE.
DISPLAY 'DIGITOS: ' DIGITOS.
DISPLAY 'CONTADOR: ' CONTADOR.
DIVIDE DIGITOS INTO BASE
GIVING TEMPORAL REMAINDER RESTO.
DISPLAY 'EL/LOS ULTIMO/S '
CONTADOR
' DIGITO/S DE BASE: '
RESTO.
ADD 1 TO CONTADOR.
MULTIPLY 10 BY DIGITOS.
DISPLAY 'BASE: ' BASE.
DISPLAY 'DIGITOS: ' DIGITOS.
DISPLAY 'CONTADOR: ' CONTADOR.
DIVIDE DIGITOS INTO BASE
GIVING TEMPORAL REMAINDER RESTO.
DISPLAY 'EL/LOS ULTIMO/S '
CONTADOR
' DIGITO/S DE BASE: '
RESTO.
ADD 1 TO CONTADOR.
MULTIPLY 10 BY DIGITOS.
DISPLAY 'BASE: ' BASE.
DISPLAY 'DIGITOS: ' DIGITOS.
DISPLAY 'CONTADOR: ' CONTADOR.
DIVIDE DIGITOS INTO BASE
GIVING TEMPORAL REMAINDER RESTO.
DISPLAY 'EL/LOS ULTIMO/S '
CONTADOR
' DIGITO/S DE BASE: '
RESTO.