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

The Articles of Confederation provided the newly declared republic with a means of governing _______________________. A. during and immediately after the revolu
a pizza parlor has 8 different toppings and 3 different cheeses to choose from on the menu. How many pizza combinations are possible if each pizza has 1 topping
A chemical reaction in which two elements or radicals change places with two other elements or radicals is a _______ reaction. A. double replacement B. combin
Which careers have the highest minimum experience requirement? Network administrator Software architect CIO System administrator
Solve. x __ 2 = 7 ---------------------------------------- PLEASE HELP!
The three toed sloth can travel faster in trees than on the ground, as shower on the table. If a sloth traveled 2.5 hours, how much farther could it go in the t
what is 2/5 + 3/7 in the LCD way
Who took the lead in making sure the bill of rights was eventually included in the constitution
55/100 in simplest form
What does an accident of nature mean