problem1 the fibonacci numbers are defined by the


Problem1:
The Fibonacci numbers are defined by the sequence:

f1 = 1
f2 = 1
fn = fn-1 + fn-2.

Reformulate that as

Fold1 = 1;
Fold2=1;
Fnew=fold1+fold2;

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.

Request for Solution File

Ask an Expert for Answer!!
Application Programming: problem1 the fibonacci numbers are defined by the
Reference No:- TGS0501340

Expected delivery within 24 Hours