IDENTIFICATION DIVISION.
PROGRAM-ID. SWAP.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 A PIC 9(4).
77 B PIC 9(4).
77 C PIC 9(4).
PROCEDURE DIVISION.
PARA.
DISPLAY "ENTER THE VALUE OF A".
ACCEPT A.
DISPLAY "ENTER THE VALUE OF B".
ACCEPT B.
MOVE A TO C.
MOVE B TO A.
MOVE C TO B.
DISPLAY "AFTER SWAP".
DISPLAY "THE VALUE OF A IS".
DISPLAY A.
DISPLAY "THE VALUE OF B IS".
DISPLAY B.
STOP RUN.
No comments:
Post a Comment