Saturday, 1 March 2014

COBOL Program to implement Subtraction of Two numbers.



COBOL Program to implement Subtraction of Two numbers.

PROGRAM:  
       IDENTIFICATION DIVISION.
       PROGRAM-ID. SUB.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
           77 A PIC 9(3).
           77 B PIC 9(3).
           77 C PIC 9(3).
       PROCEDURE DIVISION.
       PARA.
           DISPLAY " ENTER THE VALUE OF A ".
           ACCEPT A.
           DISPLAY "ENTER THE VALUE OF B".
           ACCEPT B.
           SUBTRACT A FROM B GIVING C.
           DISPLAY "SUBTRACTION IS ", C.
           STOP RUN.

No comments: