Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
with Ada.Text_IO; use Ada.Text_IO;
procedure Fibonacci is
function Fib(N: Integer) return Integer is
begin
if N < 2 then
return N;
else
return Fib(N-1) + Fib(N-2);
end if;
end Fib;
begin
for I in 0..9 loop
Put_Line(Integer'Image(Fib(I)));
end loop;
end Fibonacci;Coding works best on desktop or with an external keyboard.