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

use long division to solve this problem. express 0.41 as a fraction in its simplest form
What are key themes of American Indian literature from this era?
3/4 of Alvin's marbles are black and 1/5 are green. What would be the ratio of black marbles to the green marbles?
Triangle ABC is isosceles. What is the length of segment BC?
Artie believes that all Asian people are more intelligent than other people. Artie is engaging in?
How many of you had trypanophobia? What is trypanophobia?
24% of 1,321 is how much? round the answer to the nearest hundredth.
what did native Americans do to help us
The Boys and Girls Club is a __________. a.drug education and prevention program established within most communitiesB.drug education and prevention program that
the side length of a square with an area of 19 square units is 19 square root. The 19 square roots is an irrational number between 4 and 5 explain why the value