-- This program finds the minimum value in an array
-- of integers.
-- Author: John Weber
with Ada.Text_Io, Ada.Integer_Text_Io;
use Ada.Text_Io, Ada.Integer_Text_Io;
-- Ada 95: From The Beginning
-- Chapter 2, Problem 3
procedure FindMin is
   Length : Integer := 0;
   Min    : Integer := 0;
   Value  : Integer := 0;
begin
   Put("How many values? ");
   Get(Length);

   Put("Enter the ");
   Put(Length, WIDTH => 4);
   Put(" values.");
   New_Line;

   for L in 1 .. Length loop
      Put("[");Put(L, WIDTH => 4);Put("] ");
      Get(Value);
      if( L = 1 or Value < Min ) then
         Min := Value;
      end if;
   end loop;

   Put(" MINIMUM --> ");
   Put(Min);
   New_Line;
end FindMin;
