The Fibonacci numbers are defined by the sequence After that, discard fold2, which is no longer needed,

Question:

The Fibonacci numbers are defined by the sequence

image text in transcribed

After that, discard fold2, which is no longer needed, and set fold2 to fold1 and fold1 to fnew. Repeat an appropriate number of times.
Implement a program that prompts the user for an integer n and prints the nth Fibonacci number, using the above algorithm.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question
Question Posted: