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

Why were women violated and why do you think women would want to fight against women violation? . In other words, how women were mistreated?
if a dice is rolled and a coin is tossed at the same time find the probability of getting prime number on dice and head of the same coin​
what is 69x420+77-1x44
Help ASAP no links please
Why was the Civil Rights Act of 1968 passed so soon after the Civil Rights Act of 1964 and the Voting Rights Act of 1965?
How to compare love to a flower
In a store, 9/200 of the shirts are pink and 69/600 are orange. What percent of the shirts are not pink or orange?​
ILL MARK BRAINLIEST TO FIRST PERSON TO ANSWER CORRECTLY Which One Doesn't Belong? Determine which equation from the four below doesn't belong and justify your a
-2/3*3/5+5/2-3/5*1/6​
about the study related with social subject​