2

In[7]:=

n = Input["Calculate the first n Fibonacci numbers. Give n:"] ;

x_pp = 0 ; x_p = 1 ; Fib = {x_pp, x_p} ;

For[i = 0, i≤n, i ++, x_0 = x_pp + x_p ; x_pp = x_p ; x_p = x_0 ; Fib = Append[Fib, x_0] ;]

Print[TableForm[Fib]]

0
1
1
2
3
5
8
13
21
34
55
89
144

Created by Mathematica  (April 10, 2007) Valid XHTML 1.1!