AAA 7.

asked • 03/23/20

Please write a C++ program on Fibonacci sequence

Numerical analysis

The Fibonacci Sequence is 0, 1, 1, 2, 3, 5, 8, 13,........: the first two terms are 0 and 1, and each term thereafter is the sum of the two preceding terms:

Fib[n] = Fib[n-1] + Fib[n-2]


Using this information write a C++ program that Calculates the Fibonacci sequence to the 50th and 100th sequence [you need a counter]. The numbers must be entered by the student [this requires a cin] for each sequence. You need a function to run both the 50 and 100. Only 2 functions in the main function [the same function, which is named fibs].


Example the numbers above 0 ➔13 if n=6 the sequence would stop at 5.


Printing:

Header with your name, assignment # and date.

Title of n [50 or 100]

The sequence of each number in series for each sequence.

Example n= 6 you would print: n=6 Fib Seq: 0, 1, 1, 2, 3, 5

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.