program bil_fibonacci;
uses crt;
var
i, a, a1, a2: 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);}
a1:=0; a2:=1;
for i:=0 to 8 do
begin
a:=a1+a2;
a2:=a1;
a1:=a;
write(a:3);
end;
readln;
end.
tahnks gan ye....
ReplyDelete