Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Sort-an-integer-array/COBOL/sort-an-integer-array.cobol
Normal file
22
Task/Sort-an-integer-array/COBOL/sort-an-integer-array.cobol
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
PROGRAM-ID. sort-ints.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 array-area VALUE "54321".
|
||||
03 array PIC 9 OCCURS 5 TIMES.
|
||||
01 i PIC 9.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
main-line.
|
||||
PERFORM display-array
|
||||
SORT array ASCENDING array
|
||||
PERFORM display-array
|
||||
|
||||
GOBACK
|
||||
.
|
||||
display-array.
|
||||
PERFORM VARYING i FROM 1 BY 1 UNTIL 5 < i
|
||||
DISPLAY array (i) " " NO ADVANCING
|
||||
END-PERFORM
|
||||
DISPLAY SPACE
|
||||
.
|
||||
Loading…
Add table
Add a link
Reference in a new issue