Laman

Kamis, 02 Mei 2013

Contoh PERFORM – VARYING – AFTER 1 Pada Cobol


IDENTIFICATION DIVISION.
PROGRAM-ID. ulang5.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 X PIC 9.
77 Y PIC 9
PROCEDURE DIVISION.
Program-utama.
PERFORM Cetak-nilai -XY
VARYING X FROM 1 BY 1 UNTIL X > 3
AFTER Y FROM 1 BY 1 UNTIL Y > 2.
STOP RUN.
Cetak-nilai-XY.
DISPLAY ‘ nilai X = ‘ , X, ‘ Y = ‘ , Y.
Hasil eksekusi :
nilai X = 1 Y = 1
nilai X = 1 Y = 2
nilai X = 2 Y = 1
nilai X = 2 Y = 2
nilai X = 3 Y = 1
nilai X = 3 Y = 2

Tidak ada komentar:

Posting Komentar