with Ada.Text_IO,Ada.Integer_Text_IO;
use Ada.Text_IO,Ada.Integer_Text_IO;
procedure IntAttrs is
type BUG_RANGE is range -13..34;
Rat:Integer;
Dog:Natural;
Cat:Positive;
Bug:BUG_RANGE;
begin
Rat:=12;
Dog:=23;
Cat:=31;
Bug:=-11;Put("The type INTGER uses");Put(Integer'Size);Put("bits of memory");
New_Line;Put(" and has range from ");Put(Integer'First);Put(" to ");Put(Integer'Last);
New_Line;Put(" rat has present value of:");Put(Rat);New_Line(2);Put("the type NATURAL uses:");Put(Natural'Size);Put(" bits of memory,");
New_Line;Put(" and has range from ");
Rat:=Natural'First;Put(Rat);Put(" to ");
New_Line;
Rat:=Natural'Last;Put(Rat);
New_Line;Put(" Dog has a present value of ");Put(Dog);New_Line(2);Put("The type POSITIVE uses ");Put(POSITIVE'SIZE);Put(" bits of memory,");
New_Line;Put(" and has a range from ");Put(POSITIVE'FIRST);Put(" to ");Put(POSITIVE'LAST);
New_Line;Put(" Cat has a present value of ");Put(Cat);New_Line(2);Put("The type BUG_RANGE uses ");Put(INTEGER(BUG_RANGE'SIZE));Put(" bits of memory,");
New_Line;Put(" and has a range from ");Put(INTEGER(BUG_RANGE'FIRST));Put(" to ");Put(INTEGER(BUG_RANGE'LAST));
New_Line;Put(" Bug has a present value of ");Put(INTEGER(Bug));New_Line(2);
end IntAttrs;