Program Fibonacci;
Uses wincrt;
var
a,b,c,i,n :integer;
begin
write('masukkan n= ');readln(n);
a:=1 ; b:=0 ;
for i := 1 to n do
begin
c:=a+b;
a:= b;
b:= c;
write(c, ' ');
end;
end.
Uses wincrt;
var
a,b,c,i,n :integer;
begin
write('masukkan n= ');readln(n);
a:=1 ; b:=0 ;
for i := 1 to n do
begin
c:=a+b;
a:= b;
b:= c;
write(c, ' ');
end;
end.
Posting Komentar