Fibonacci Sequence
-
A Fibonacci sequence is a sequence of numbers where each successive
number is the sum of the previous two.
- The classic Fibonacci sequence
begins: 1, 1, 2, 3, 5, 8, 13, ....
- Write a program that computes the nth Fibonacci number where n is a
value input by the user.
- For example, if n = 6, then the result is 8.
To keep this exercise simple, you need not print out the prompt
string. Simply read an integer and print out an integer.
For example, the input
6
will generate the output
8