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

TRUE Or false NO WEIRD ANSWERS OR LINKS OR YOU WILL BE REPORTED.
what is the answer to 3x=-3x-6
An isosceles triangle has two angles that measure 37 degrees. What is the measure of the third angle
what is the answer for a and b ?
pls help 6th grade math
Read the excerpt from "The Discovery of Oz, the Terrible." "I thought Oz was a great Head," said Dorothy. . . . "No. . ." said the little man meekly. "I have be
what is the length of side c?
Do It! Review 11-3a Skysong, Inc. has 2,600 shares of 7%, $130 par value preferred stock outstanding at December 31, 2019. At December 31, 2019, the company dec
70 POINTS SHOW HOW U DID IT FOR BRAINLIEST
The gases that surround Earth are called __________. the core the atmosphere respiration humus