Answer to Question #287380 in C++ for Ahmed Khan

Question #287380

Develope a Fibonacci series of 20 numbers. Now push these elements into stack and then pop them.After pop each element should get inserted into queue and after dequeuing each element get inserted in link list and then print that linked list.

1
Expert's answer
2022-01-13T16:11:50-0500
#include<bits/stdc++.h>
using namespace std;


int fibonacci(int n)
{
    if (n <= 1)
        return n;
    return fibonacci(n-1) + fibonacci(n-2);
}


int main ()
{
    int n = 9;
    cout << fibonacci(n);
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment