Programming Home Work 3
Programming Home Work 3
Page 2 of 2
Java Simple Programs
Fibonacci Number Output 1:
Write a method that returns the nth
element of the Fibonacci Sequence The 0 1 1 2 3 5 8 13 21 …….
Fibonacci Sequence is the series of
numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21 The next
number is found by adding up the two
numbers before it.
Assume that indexes start at zero, e.g.,
fib(0) = 0, fib(1) = 1, ...
Page 4 of 2