IDENTIFICATION DIVISION.
PROGRAM-ID. NUM.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 N PIC 9(3).
77 I PIC 9(3) VALUE 10.
77 R PIC 9(3).
77 Q PIC 9(3).
PROCEDURE DIVISION.
READ-PARA.
DISPLAY "Enter the limit"
ACCEPT N.
IF N < 10
DISPLAY "NO NUMBER DIVISIBLE BY 5 "
GO TO EXIT-PARA.
DISPLAY "EVEN NUMBERS DIVISIBLE BY 5".
COMPUTE-PARA.
IF I > N GO TO EXIT-PARA.
DIVIDE I BY 4 GIVING Q REMAINDER R
IF R NOT = 0
DISPLAY I.
ADD 10 TO I
GO TO COMPUTE-PARA.
EXIT-PARA.
STOP-RUN.
No comments:
Post a Comment