RosettaCodeData/Task/Compile-time-calculation/Ada/compile-time-calculation-2.ada
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

16 lines
355 B
Ada

with Ada.Text_Io;
procedure CompileTimeCalculation is
function Factorial (Int : in Integer) return Integer is
begin
if Int > 1 then
return Int * Factorial(Int-1);
else
return 1;
end if;
end;
Fact10 : Integer := Factorial(10);
begin
Ada.Text_Io.Put(Integer'Image(Fact10));
end CompileTimeCalculation;