Open in CoCalc with one click!
1
-- For loop in Ada on CoCalc
2
3
with Ada.Text_IO;
4
5
procedure Range_1 is
6
type Range_Type is range -5 .. 19;
7
8
package T_IO renames Ada.Text_IO;
9
package I_IO is new Ada.Text_IO.Integer_IO (Range_Type);
10
11
begin
12
for A in Range_Type loop
13
I_IO.Put (Item => A,
14
Width => 3,
15
Base => 10);
16
17
if A < Range_Type'Last then
18
T_IO.Put (",");
19
else
20
T_IO.New_Line;
21
end if;
22
end loop;
23
end Range_1;