-- Chapter 18 - Program 5 with Ada.Text_IO, Ada.Integer_Text_IO; use Ada.Text_IO, Ada.Integer_Text_IO; procedure Revers is type MY_ARRAY is array(3..10) of INTEGER; Store_Here : MY_ARRAY := (3, 16, -5, 6, 12, 66, -13, 57); Another : MY_ARRAY; function Reverse_Array(Data : MY_ARRAY) return MY_ARRAY is Temp : MY_ARRAY; begin for Index in Data'RANGE loop Temp(Index) := Data(Data'FIRST + Data'LAST - Index); end loop; return Temp; end Reverse_Array; begin for Index in Store_Here'Range loop Put(Store_Here(Index), 5); end loop; New_Line; Another := Reverse_Array(Store_Here); for Index in Another'Range loop Put(Another(Index), 5); end loop; New_Line; Another := Reverse_Array(Another); for Index in Another'Range loop Put(Another(Index), 5); end loop; New_Line; end Revers; -- Result of Execution -- 3 16 -5 6 12 66 -13 57 -- 57 -13 66 12 6 -5 16 3 -- 3 16 -5 6 12 66 -13 57