Skip to content
Snippets Groups Projects

Updates cpp 2023

Merged John Tinnerholm requested to merge Updates-Cpp-2023 into master
18 files
+ 453
416
Compare changes
  • Side-by-side
  • Inline
Files
18
lab1/test/code 0 → 100644
+ 33
0
/*
This test checks the fibonacci function
Author: John Tinnerholm
*/
declare
a : integer;
function fib (x : integer) : integer
begin
if x == 0 then
begin
return 0;
end
elseif x == 1 then
begin
return 1;
end
else
begin
return fib(x - 1) + fib(x-2);
end
if;
end;
begin
a := 0;
while a < 10 do
begin
putint(fib(a));
putline();
a := a + 1;
end
while;
end;
Loading