Deret Fibonaci dengan Program BASIC

19Sep07

Saya coba berbagi ilmu dalam pemrograman BASIC dengan membuat program sederhana yaitu deret fibonacci. Semoga bermanfaat ^_^

Deret Fibonacci

Suku deret :
0 1 1 2 3 5 8 …

Program Basic:

‘*********************
‘* Deret Fibbonaci *
‘*********************
CLS
INPUT “Masukan jumlah deret : “, suku
a = 0
b = 1
c = 1
FOR i = 1 TO suku
IF i = 1 THEN
PRINT a; ” “;
ELSEIF i = 2 THEN
PRINT b; ” “;
ELSE
c = a + b
a = b
b = c
PRINT c; ” “;
END IF
NEXT
END



No Responses Yet to “Deret Fibonaci dengan Program BASIC”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: