newguy45
2008-10-14 23:26:48
So I was bored today and decided to code the the Fibonacci Sequence
program FibonacciSequance;
var n1, n2, n3, repeatcount:integer;
procedure firstrun;
begin
n1:=0;
n2:=1;
n3:=n1+n2;
writeln(IntToStr(n1));
writeln(IntToStr(n2));
writeln(IntToStr(n3));
end;
procedure mainrun;
begin
n1:=n2
n2:=n3
n3:=n1+n2
writeln(IntToStr(n3));
end;
begin
repeatcount:=0;
firstrun;
repeat
repeatcount:=repeatcount+1
mainrun;
until(repeatcount = 15);
end.