The Ada Program: main.adb

  1 -- main.adb:  use a separately compiled function to compute Euler's phi function
  2 
  3 with Ada.Text_IO, Ada.Integer_Text_IO, Euler_Phi;
  4 use Ada;
  5 
  6 procedure Main is
  7    N: Positive;
  8 begin
  9    Text_IO.Put ("Enter a number greater than 1 => ");
 10    Integer_Text_IO.Get (N);
 11    Text_IO.New_Line;
 12    Text_IO.Put ("There are ");
 13    Integer_Text_IO.Put (Euler_Phi(N), Width=>1);
 14    Text_IO.Put (" numbers smaller than ");
 15    Integer_Text_IO.Put (N, Width=>1);
 16    Text_IO.Put_Line (" and relatively prime to it.");
 17 end Main;