Question: Write a function in C++ that will implement each Fibonacci number with the help of an integer array of size 100 (elements of this array

Write a function in C++ that will implement each Fibonacci number with the help of an integer array of size 100 (elements of this array will be digits of the Fibonacci number). When the function is called to find F(n), it will calculate all Fibonacci numbers from F(2) to F(n). using the basic formula F(n) = F(n-1) + F(n-2). To add two Fibonacci numbers, the function will add elements of two arrays corresponding to F(n-1) and F(n-2) and store their sums in the array corresponding to F(n). (You are NOT supposed to store ALL arrays.) Write a program that will calculate Fibonacci numbers containing up to 100 digits. Display the biggest Fibonacci number that has less than 100 digits. Make sure that your program will display the error message when a Fibonacci number has 100 digits or more.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!