Consider the following code to find the nth fibonacci term: [code] int fibo(int n) if n == 0 return 0 else prevFib

Ivanesn

New member
Consider the following code to find the nth fibonacci term:
Code:
int fibo(int n)
    if n == 0
       return 0 
    else
       prevFib = 0
       curFib = 1
       for i : 1 to n-1
           nextFib = prevFib + curFib
	   __________
  	   __________
       return curFib
Complete the above code.
A.
prevFib = curFib
curFib = curFib
B.
prevFib = nextFib
curFib = prevFib
C.
prevFib = curFib
curFib = nextFib
D.
prevFib = nextFib
nextFib = curFib
 

Tìm kiếm

Back
Top