home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / programm / prog2 / answers / ch06_1.ada < prev    next >
Encoding:
Text File  |  1991-07-01  |  921 b   |  43 lines

  1.                               -- Chapter 6 - Programming exercise 1
  2. with Text_IO;
  3. use Text_IO;
  4.  
  5. procedure Ch07_1 is
  6.  
  7. package Long_IO is new Text_IO.Integer_IO(LONG_INTEGER);
  8. use Long_IO;
  9.  
  10. package Short_IO is new Text_IO.Integer_IO(SHORT_INTEGER);
  11. use Short_IO;
  12.  
  13. Long_Variable  : LONG_INTEGER;
  14. Short_Variable : SHORT_INTEGER;
  15.  
  16. begin
  17.    Put_Line("For LONG_INTEGER,");
  18.    Put(LONG_INTEGER'FIRST);
  19.    Put_Line(" is the minimum value");
  20.    Put(LONG_INTEGER'LAST);
  21.    Put_Line(" is the maximum value");
  22.  
  23.    Put_Line("For SHORT_INTEGER,");
  24.    Put(SHORT_INTEGER'FIRST);
  25.    Put_Line(" is the minimum value");
  26.    Put(SHORT_INTEGER'LAST);
  27.    Put_Line(" is the maximum value");
  28. end Ch07_1;
  29.  
  30.  
  31.  
  32.  
  33. -- Result of execution
  34.  
  35. -- For LONG_INTEGER
  36. -- -2147483648 is the minimum value
  37. --  2147483647 is the maximum value
  38. -- For SHORT_INTEGER
  39. -- -128 is the minimum value
  40. --  127 is the maximum value
  41.  
  42.  
  43.