Question: //main.cpp #include using namespace std; int fibonacci(int n) { return 0; } int main() { cout cout return 0; } Problem Complete the fibonacci function

//main.cpp
#include
using namespace std;
int fibonacci(int n) {
return 0;
}
int main() {
cout
cout
return 0;
}
Problem Complete the fibonacci function in main. cpp, which finds the n th Fibonacci number where: fibonacci (1) 1 fibonacci (2) 1 fibonacci (n) fibonacci (n 2) fibonacci (n 1) You must implement fibonacci efficiently, where fibonacci (1000) should take only a trivial amount of time to run. Hint: You will need to add a data structure to the program! Compile and Test A complete Makefile and a main.cpp file containing one simple test has been provided for you. To compile and run, run: make /main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
