Deret Fibbonacci is one kinds of deret with value of f0 and f1 are same.
General formula of Deret Fibbonacci is :
fk = fk-1 + fk-2 . dengan k = 2, 3, 4, 5, …
And f0 = 1, f1 = 1.
We could finish the Deret Fibbonacci case with statement like this :
Program deretFibonaci;
uses wincrt;
var f : array[0..25] of integer;
I, n : integer;
begin
write('write sum of deret : ');
readln(n);
f[0] := 1; f[1] := 1;
write('Deret Fibonaci :');
Write(f[0]:5, f[1]:5);
For I := 2 to n do
begin
f[i] := f[i-1] + f[i-2];
write(f[i]:5);
end;
readln
end.
if we run the statement,we are get output like this :
3 comments:
thax baget y bro...
makasih, jd bnyk belajar..
kalau tribonacci gmana ya??
Post a Comment