Input and Output are not part of the Ada language
package int_io is new TEXT_IO.INTEGER_IO(INTEGER); use int_io; package flt_io is new TEXT_IO.FLOAT_IO(FLOAT); use flt_io;
Specify libraries at start of procedure
PUT ( "Please enter the first number "); GET ( number1 );
PUT ( "Please enter the first number "); GET ( number1 ); skip_line; PUT ( "Please enter the second number "); GET ( number2 ); skip_line; Please enter the first number 42 10 Please enter the second number 23
PUT ( "Please enter the first number "); GET ( number1 ); skip_line; Please enter the first number: ffffffff
PUT_LINE ("string")
PUT ( "Please enter the first number "); GET ( number1 ); skip_line; Please enter the first number: ffffffffNEW_LINE
PUT(int_val, WIDTH => positive_integer);
PUT ("The sum of the numbers is:"); PUT (number1+number2, width=>7); NEW_LINE; PUT ("The product of the numbers is:"); PUT (number1*number2, width=>3); NEW_LINE; PUT ("The sum of the numbers is:"); PUT (number1+number2, width=>1); NEW_LINE; The sum of the numbers is: 16 The product of the numbers is: 48 The sum of the numbers is:16
PUT(real_val, FORE => positive_integer, AFT => positive_integer, EXP => positive_integer);
PUT (23.456); PUT (23.456, EXP=>0); PUT (23.456, AFT=>3, EXP=>0); PUT (23.456, AFT=>2, EXP=>0); PUT (23.456, FORE=>3, AFT=>3, EXP=>0); ' 2.34560000000000E+01' '23.45600000000000' '23.456' '23.46' ' 23.456'
An example program shows (among other things) the use of input and output statements.