The Ada Program: io.adb
1 -- io.adb: get an integer and a float
2
3 with Ada.Text_IO, Ada.Float_Text_IO, Ada.Integer_Text_IO;
4 use Ada;
5
6 procedure IO is
7
8 Int: Integer;
9 Real: Float;
10
11 begin
12
13 Text_IO.Put ("Enter an integer => ");
14 Integer_Text_IO.Get (Int);
15 Text_IO.Put ("You entered ");
16 Integer_Text_IO.Put (Int);
17 Text_IO.New_Line;
18
19 Text_IO.Put ("Enter a real number => ");
20 Float_Text_IO.Get (Real);
21 Text_IO.Put ("You entered ");
22 Float_Text_IO.Put (Real, Aft=>2, Exp=>0);
23 Text_IO.New_Line;
24
25 end IO;