10.2.. Učitati članove i naći najmanji član niza.
Listing programa:
PROGRAM P10511002;
USES
WinCrt;
CONST
n = 5;
VAR
i, tmin : INTEGER;
X : ARRAY [1..n] OF INTEGER;
BEGIN
WRITELN('NAJMANJI CLAN NIZA');
FOR i := 1 TO n DO {ulaz}
BEGIN
WRITE(i,' --> ');
READLN(X[i]);
END;
tmin := X[1];
FOR i := 2 TO n DO
IF tmin > X[i] THEN
tmin := X[i];
WRITELN('NAJMANJI CLAN NIZA ', tmin);
END.
Ispis na ekranu:
Index
|