10.2.. Učitati članove i naći najmanji član niza.
Listing programa:
PROGRAM P10511006;
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 := ABS(X[1]);
FOR i := 2 TO n DO
IF tmin > ABS(X[i]) THEN
tmin := ABS(X[i]);
WRITELN('NAJMANJI CLAN NIZA ', tmin);
END.
Ispis na ekranu:
Index
|