Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
with Ada.Text_IO; use Ada.Text_IO;
procedure Factorial is
function Fact(N: Integer) return Integer is
begin
if N <= 1 then
return 1;
else
return N * Fact(N-1);
end if;
end Fact;
begin
Put_Line("Factorial 5: " & Integer'Image(Fact(5)));
end Factorial;Coding works best on desktop or with an external keyboard.