IDENTIFICATION DIVISION.
PROGRAM-ID. AVGGRADE.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A.
02 INP PIC 99 OCCURS 10 TIMES INDEXED BY X1.
01 CMP PIC 99 VALUE 10.
01 VAL PIC 99.
01 I PIC 99.
PROCEDURE DIVISION.
1000-ACCEPT.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 10
ACCEPT INP(I)
END-PERFORM.
2000-SEARCH.
SEARCH INP
AT END DISPLAY "NUMBER NOT FOUND " CMP
WHEN CMP = INP(X1)
DISPLAY "NUMBER FOUND".
STOP RUN.
PROGRAM-ID. AVGGRADE.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A.
02 INP PIC 99 OCCURS 10 TIMES INDEXED BY X1.
01 CMP PIC 99 VALUE 10.
01 VAL PIC 99.
01 I PIC 99.
PROCEDURE DIVISION.
1000-ACCEPT.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 10
ACCEPT INP(I)
END-PERFORM.
2000-SEARCH.
SEARCH INP
AT END DISPLAY "NUMBER NOT FOUND " CMP
WHEN CMP = INP(X1)
DISPLAY "NUMBER FOUND".
STOP RUN.
No comments:
Post a Comment