junelsingh7 junelsingh7
  • 14-06-2021
  • Computers and Technology
contestada

WAP to print given series by using sub procedure 2,3,5,8,13,...........,20th term.​

Respuesta :

buingocmyan buingocmyan
  • 14-06-2021

Answer: c++

int fibonacci(int n) {

if (n < 0) {

return -1;

} else if (n == 0 || n == 1) {

return n;

} else {

return fibonacci(n - 1) + fibonacci(n - 2);

}

}

int main() {

int i;

for (i = 0; i < 20; i++) {

cout << fibonacci(i) << " ";

}

}

Explanation:

this is fibonacci

Answer Link

Otras preguntas

Which equation has a slope of -2 and a y-intercept of 4? A. y = 2x - 4 B. y = -2x - 4 C. y = -2x + 4 D. y = 2x + 4
What is difference between a community and a population? A community has only one
the ages of people working in an office are shown in the stem and leaf plot. find the mean median and mode of the data
Do certain cultures place more value on being a boy or being a girl? Why
What are three ways in which the structure of RNA differs from that of DNA
a movie theater has 24 screens the ratio of action films two other films currently showing on all of the screens 1:2 how many action films are currently showing
Can work managers not allow employee to have 15 min breaks? Is anything like that a law or what?
This banker built the United states steel corporation
Find n for a series for which a1= 30, d = -4, and Sn = -210. a. -21 b. 21 c. -10 d. 10 Please select the best answer from the choices provided a) A b) B c) C d)
can someone answer these or walk me through them