PROGRAM
DERET 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.
Tidak ada komentar:
Posting Komentar