Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IDENTIFICATION DIVISION.
- PROGRAM-ID. PROGRAMA.
- DATA DIVISION.
- WORKING-STORAGE SECTION.
- 01 ARRAY.
- 05 ELEMENTO PIC 9 OCCURS 10 INDEXED BY I.
- PROCEDURE DIVISION.
- MAIN-PROCEDURE.
- PERFORM CARGAR-ARRAY.
- PERFORM MOSTRAR-ARRAY.
- CALL "QSORT" USING ARRAY, 1, 10.
- PERFORM MOSTRAR-ARRAY.
- STOP RUN.
- CARGAR-ARRAY.
- MOVE 5 TO ELEMENTO(1).
- MOVE 7 TO ELEMENTO(2).
- MOVE 2 TO ELEMENTO(3).
- MOVE 8 TO ELEMENTO(4).
- MOVE 3 TO ELEMENTO(5).
- MOVE 0 TO ELEMENTO(6).
- MOVE 4 TO ELEMENTO(7).
- MOVE 9 TO ELEMENTO(8).
- MOVE 1 TO ELEMENTO(9).
- MOVE 6 TO ELEMENTO(10).
- MOSTRAR-ARRAY.
- PERFORM VARYING I FROM 1 BY 1 UNTIL I > 10
- DISPLAY ELEMENTO(I) ' ' WITH NO ADVANCING
- END-PERFORM.
- DISPLAY ' '.
- END PROGRAM PROGRAMA.
Add Comment
Please, Sign In to add comment