Membuat deret fibonacci dengan menggunakan bahasa pemrograman PASCAL
program deretfibonacci;
uses wincrt;
var
i,penambah,suku : integer;
deret : array[1..100] as integer;
begin
read(suku);
for i = 1 to suku do
if i = 1 then
begin
deret[i] = 1;
penambah = 0
end
else
begin
deret [i] = deret[i-1] + penambah;
penambah = deret [i-1]
end;
'cetak deret
for i = 1 to suku do
write(deret[i])
end.
Wednesday, November 4, 2009
Program Deret Fibonacci
Labels:
Pascal,
Pascal-Fibonacci
Subscribe to:
Post Comments (Atom)
salam sahabat
ReplyDeleteehm..good posting make me know more...thnxs n good luck ya...
trims dah mampir....
ReplyDeletesalam
gaplek
ReplyDelete