Program Fibonacci;
Uses wincrt;
Procedure fibo(key:string:k:integer);
Var
x,y,z,i,v:longint;
Baris:word;
Begin
x:=1;
y:=1;
Writeln(‘*’,key,’*’);
For baris:=1 to k do
Begin
Writeln;
End;
Write(‘masukkan bilangan= ‘):readln(n);
Write(x,’ ’);
Write(y,’ ‘);
For i:=1 to n-2 do
Begin
z:=x+y;
x:=y;
y:=z;
Write(z,’ ‘);
End;
End;
end.
Program Fibonacci
03.00 |
Label:
Contoh Program Pascal
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar