Saturday, 1 March 2014

COBOL Program to implement Division of Two numbers.



COBOL Program to implement Division of Two numbers.

PROGRAM:  

       IDENTIFICATION DIVISION.
       PROGRAM-ID. DIV.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
           77 A PIC 9(3).
           77 B PIC 9(3).
           77 C PIC 9(3).
           77 D PIC 9(3).
       PROCEDURE DIVISION.
       PARA.
           DISPLAY " ENTER THE VALUE OF A ".
           ACCEPT A.
           DISPLAY "ENTER THE VALUE OF B".
           ACCEPT B.
           DIVIDE A BY B GIVING C REMAINDER D.
           DISPLAY "DIVISION  IS ", C.
           DISPLAY " REMAINDER IS ", D.
           STOP RUN.






No comments: