( Fibonacci numbers) Rewrite the fib function in Listing 17.2 using iterations.
Hint: To compute fib(n) without recursion, you need to obtain fib(n - 2) and fib(n - 1) first. Let f0 and f1 denote the two previous Fibonacci numbers. The current Fibonacci number would then be f0 + f1. The algorithm can be described as follows:

Write a test program that prompts the user to enter an index and displays its Fibonacci number
Listing 17.2 ComputeFibonacci.cpp


We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.