Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

minimo

program minimo_con_procedure;

uses crt;
const max=100;
var a:array[1..100]of integer;
    i,n,min:integer;
    risp:char;

procedure input;
  begin
    repeat
      writeln('immetti la dimensione');
      readln(n);
    until (n>0) and (n<=max);
    randomize;
    for i:=1 to n do
      a[i]:=random(50)+1;
  end;
  
procedure minimo;
  begin
    min:=a[1];
    for i:=1 to n do
      if (a[i]<min) then min:=a[i];
  end;
  
procedure output;
  begin
    for i:= 1 to n do
      writeln ('il ',i,'° numero e'' ',a[i]);
    writeln('il minimo e'' ',min);
  end;


BEGIN
  repeat
    input;
    minimo;
    output;
    writeln('vuoi ripetere? s o n');
    readln(risp);
  until (risp='n');
END.

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.