Napisati program sa procedurom za odredjivanje minimuma tri broja.

Listing programa:

PROGRAM Minimum;
VAR
 a, b, c, min :Integer;

PROCEDURE minim(a, b, c: Integer; VAR min: Integer);
BEGIN
  min := a;
  IF b < min THEN
    min := b;
  IF c < min THEN
    min := c;
END;

BEGIN       {MAIN}
  Writeln ('Minimum od tri ucitana broja ');
  Write ('a, b, c ');
  Readln(a, b, c);
  minim (a, b, c, min);
  Writeln('Minimum je  ', min);
  READLN;
END.

Ispis na ekranu:
Minimum od tri ucitana broja
a, b, c 4 2 3
Minimum je: 2

Index