Determine index minimal member in array of number
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Author: Juraj Pupák
Program: Postcise.pas
File exe: Postcise.exe
Author: Juraj Pupák
Program: Postcise.pas
File exe: Postcise.exe
Determine index minimal member in array of number.
{ POSTCISE.PAS } { Urci poziciu a hodnotu minimalneho prvku v poli cisel. } { } { Author: Juraj Pupak } { Date : 27.10.2006 http://www.trsek.com } program PostupnostCisel; uses crt; var Pole : array [1..20] of integer; min_number,temp : integer; i,a : integer; begin clrscr; min_number := 100; Randomize; For i := 1 To 20 Do begin Pole[i] := Random (100); IF Pole[i] < min_number THEN begin min_number := Pole[i]; end; end; For a := 1 To 20 Do begin IF Pole[a] = min_number THEN writeln('Min. prvok sa nachadza v poli na indexe ',a); end; writeln('Minimalny prvok pola je ',min_number); readln; end.