program min_max;
uses wincrt;
var
a : array[1..100] of real;
i,n : integer;
max,min : real;
begin
writeln ('masukkan banyaknya data:'); readln(n);
max:=-9999;
min:=9999;
clrscr;
for i:=1 to n do begin
writeln ('data ke: ',i); readln (a[i]);
if max<(a[i]) then max := (a[i]);
if min>(a[i]) then min := (a[i]);
end;
writeln('nilai maksimum : ', max:6:2);
writeln('nilai minimum : ', min:6:2);
end.
Tidak ada komentar:
Posting Komentar