1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sergeeva-Olga [200]
3 years ago
7

Complete computefibonacci() to return fn, where f0 is 0, f1 is 1, f2 is 1, f3 is 2, f4 is 3, and continuing: fn is fn-1 + fn-2.

hint: base cases are n == 0 and n == 1.
Mathematics
1 answer:
anastassius [24]3 years ago
3 0

Answer:

Fibonacci series is given by

f(0)=0, f(1)=1, f(2)=1, f(3)=2, f(4)=3.....

As you can see using the above result

f(4)=f(3) + f(2),

f(3)=f(2) + f(1),

f(2)=f(1) + f(0)

Proceeding using same pattern

f(5)=f(4) + f(3)=3+2=5

f(6)=f(4) + f(5)=3+5=8

f(7)=f(6) + f(5)=8+5=13

f(8)=f(7) + f(6)=13+8=21

f(9)=f(8) + f(7)= 21+13=34

f(10)=f(9) + f(8)=34+21=55

...........................................

..........................................

f(n-2)=f(n-3)  + f(n-4)

f(n-1)=f(n-2)+ f(n-3)

Similarly and finally we get using the same pattern we get, As given f(n)=f(n-1) + f(n-2).




You might be interested in
G=(z-s)/r solve for z
ryzh [129]

Step-by-step explanation:

G = (z-s) ÷ r

G × r = (z- s)

Gr + s = z

6 0
3 years ago
Please help ASAP show work^
Art [367]

Answer:x=6

Step-by-step explanation: Remove the radical by raising each side to the index of the radical

4 0
3 years ago
PLEASE HELP!!!
Jobisdone [24]
The answer it 1. is A.
The answer to 2. is B.
6 0
3 years ago
Consider the following switch statement where x is an int. If x is currently equal to 5, what will the value of x be after the s
Sphinxa [80]

Answer:

x=11

Step-by-step explanation:

The switch case works like an if or if-else, where each of the cases are conditionals. Here we have 7 cases and we know that our variable begins with x=5.

First, it enters to case 5 because of x=5, so x+=3, this means we add 3 to the actual value of the variable ⇒ x=8.  

At this point, if there's not break the program continues to the next case, executing the statements until a break or the end on the switch is reached.  

In this order, the x = 8 and next we add 1 (case 6) ⇒ x=9. We add 2 (case 7) x+=2 ⇒ x=10. Then we rest 1 (case 8) ⇒ x=9 and then we add 1 again as in case 9 ⇒ x=11.

3 0
3 years ago
Maths giving 10 point asap 1 question only<br><br><br><br><br><br>Find the value of P​
timurjin [86]

Answer:

p=7

Step-by-step explanation:

pqrs equal to tuv perimeters =60

triangle=20×3

60

Trapezium=(p+8)+12+12+3p

60=4p+32

4p=28

p=7

5 0
3 years ago
Read 2 more answers
Other questions:
  • PLEASE HELP ASAP
    6·1 answer
  • What percent of 100 is 79?
    11·2 answers
  • Find the rational solution of x3 – 3x2 + x + 5 = 0. Show your use of the Rational Zero Theorem to receive credit!
    11·1 answer
  • May someone help me with this plzzz
    7·2 answers
  • Ramona has $3.28. She divides the money into 2 equal amounts: one for saving and one for spending. What amount of money does she
    13·1 answer
  • PLEASE HELP ME WITH MATH!
    11·2 answers
  • ) In 2005, the Health Department in Marion County, Indiana measured the heights and weights of 90,147 school-age children, allow
    5·1 answer
  • Simplify.<br> Cubed root of -128x^6y^5
    12·1 answer
  • I need help with Function Operations please
    6·1 answer
  • What is the tangent<br> ratio of angle C₂ ?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!