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

What does the cytoplasm do in the cell? directs all cell activity uses sunlight to make food storage of water and food transports waste and glucose
What does changing the “a” do to the graph of a quadratic equation?
Your essay will use research to describe the Iditarod's history
A new car is purchased for $43,000 and over time its value depreciates by one half every 6 years. What is the value of the car 29 years after it was purchased,
A structure outside the plasma membrane in some cells is the _____
C. Marcia made 10 bracelets for 5 friends. Jen made 12 bracelets for 4 friends. Are these rates equivalent? Explain your reasoning.
Which of the following types of selection tends to maintain the diversity of alleles in a population with respect to a given gene, over many generations? Choose
Equations by Elimination 8) 7x + 2y = 24 8x + 2y = 30
What’s 7/8 x 1/3 in simplest form
(5x +8 - 6x)(4 + 2x - 7)