Fibonacci Sequence

  1. A Fibonacci sequence is a sequence of numbers where each successive number is the sum of the previous two.
  2. The classic Fibonacci sequence begins: 1, 1, 2, 3, 5, 8, 13, ....
  3. Write a program that computes the nth Fibonacci number where n is a value input by the user.
  4. 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