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

Please help!! I need this urgently I will mark you brainliestwrite a descriptive essay on the topic " ultimate success"​
I need help can someone help me ​
The income of a person is Rs 18,000 per month .due to the exemption of the income of Rs 1,40,000 per year, he has paid Rs 11,400 as an income tax at the end of
A manufacturer of precision measuring instruments claims that the standard deviation in the use of the instruments is at most 0.00002 millimeter. An analyst who
what happen to the populist party in the 1892 presidential election?
A simple pendulum of length 1.5m has a bob of mass 2.0kg. State the formula for the period of small oscillations and evaluate it in this case. (2.43s)​
1. If the forces acting upon an object are balanced, can the object be accelerated?​
Answer number 2 pleaseeee thank you
How many milligrams of sodium chloride are contained in 1 liter of 0.6% sodium chloride solution? A. 600 mg B. 0.6 mg C. 6000 mg D. 0.06 mg
Please answer all parts of number 2.