PROGRAM FIBONACCI DENGAN BAHASA PASCAL
program bil_fibonacci;
uses wincrt;
const
n=10;
var
i, f, f1, f2: integer;
x: array[1..n] of integer;
begin
clrscr;
writeln('ingin mencetak bilangan fibonacci');
write('sampai suku ke - '); readln (x[i]);
writeln;
writeln('suku ke- 1= ',1);
writeln('suku ke- 2= ',1);
f1:= 1; f2:=1;
for i:=3 to n do
begin
f:=f1+f2;
writeln('suku ke-',i:2,'=',f:3);
f2:=f1; f1:=f;
end;
end.