Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
with Ada.Text_IO; use Ada.Text_IO;
procedure List_Sum is
Arr : array(1..5) of Integer := (1,2,3,4,5);
Sum : Integer := 0;
begin
for I in Arr'Range loop
Sum := Sum + Arr(I);
end loop;
Put_Line("Sum: " & Integer'Image(Sum));
end List_Sum;Coding works best on desktop or with an external keyboard.