|
|
|
|
|
|
|
|
|
|
* |
|
|
IDENTIFICATION |
|
DIVISION. |
|
|
PROGRAM-ID. |
|
T2. |
|
* |
|
|
ENVIRONMENT |
|
DIVISION. |
|
|
CONFIGURATION |
|
SECTION. |
|
|
SOURCE-COMPUTER. |
|
SAMSUNG. |
|
|
OBJECT-COMPUTER. |
|
SAMSUNG. |
|
* |
|
|
DATA |
|
DIVISION. |
|
|
WORKING-STORAGE |
|
SECTION. |
|
* |
|
|
77 |
A |
PIC |
9(7) |
VALUE 0. |
|
|
77 |
B |
PIC |
9(7). |
|
|
|
|
77 |
C |
PIC |
9(7).99. |
|
|
|
77 |
D |
PIC |
9(7). |
|
|
|
* |
|
|
PROCEDURE |
|
DIVISION. |
|
|
START-RTN. |
|
|
|
|
|
|
DISPLAY " " ERASE. |
|
* |
|
|
|
|
|
|
|
|
|
DISPLAY " Enter integer : " |
|
|
|
|
|
LINE 5 POSITION 10
REVERSE. |
|
|
|
ACCEPT A PROMPT |
|
|
|
|
|
LINE 5 POSITION 26. |
|
* |
|
|
|
|
|
|
|
|
|
DISPLAY " Enter integer : " |
|
|
|
|
|
LINE 7 POSITION 10
REVERSE. |
|
|
|
ACCEPT B PROMPT |
|
|
|
|
|
LINE 7 POSITION 26. |
|
* |
|
|
|
|
|
|
|
|
|
ADD A B GIVING C. |
|
|
|
DISPLAY A " + " B
" = " C. |
|
* |
|
|
|
|
|
|
|
|
|
SUBTRACT B FROM A
GIVING C. |
|
|
|
DISPLAY A " - " B
" = " C. |
|
* |
|
|
|
|
|
|
|
|
|
MULTIPLY A BY B GIVING
C. |
|
|
|
DISPLAY A " X " B
" = " C. |
|
* |
|
|
|
|
|
|
|
|
|
DIVIDE A BY B GIVING
C ROUNDED REMAINDER D. |
|
|
|
DISPLAY A " / " B
" = " C " ... " D. |
|
* |
|
|
|
|
|
|
|
|
END-RTN. |
|
|
|
|
|
|
|
STOP RUN. |
|
|
|
|
|
|
|
|
|
|
|