Affichage récursif de l'inversé d'un entier.

with Ada.Text_Io, Ada.Integer_Text_IO ;

procedure affinv is
  use Ada.Text_Io, Ada.Integer_Text_IO ;

  procedure Aff_Chiffre(Nb : Natural) is
  begin
     if (Nb mod 10)=0 then
        New_Line;
     else
        Put(Nb mod 10,1);
        Aff_Chiffre(Nb/10);
     end if;

end Aff_Chiffre;


Nb : Integer;
begin
  Put_Line("Affichage récursif de l'inversé d'un entier") ;
  Put("Entrer un entier : ");
  Get(Nb);
  if Nb<0 then
     Put("-");
     Aff_Chiffre(-Nb);
  else
     Aff_Chiffre(Nb);
  end if;
end affinv ;