Sabtu, 04 Desember 2010

LISTING PEMROGRAMAN PENGURUTAN

USES CRT;
CONST
 L:ARRAY[1..5] OF INTEGER =(24,20,11,54,21);
VAR I,J,TEMP: INTEGER;
BEGIN
  CLRSCR;
  FOR I:= 1 TO 4 DO
    BEGIN
      FOR J:= 1 TO 4 DO
        BEGIN
          IF (L[J]>L[J+1]) THEN
            BEGIN
              TEMP:=L[J];
              L[J]:=L[J+1];
              L[J+1]:=TEMP;
            END;
        END;
    END;
END.

Tidak ada komentar: