I have the following code, the result is 42, but why? The answer must be 13, because 7+6=13
.
program HelloWorld;
function F (a : integer) : integer;
begin
if (a = 1) or (a = 2) then
F := 2
else
F := F(a-1) + F(a-2);
end;
begin
WriteLn(F(8));
end.