Question: Write a c++ program that outputs the sequence 1 3 4 7 11 18 29 47 76 123 We start with a 1 and 3

Write a c++ program that outputs the sequence 1 3 4 7 11 18 29 47 76 123

We start with a 1 and 3 and generate each subsequent number by adding the previous two. Your program should initialize two variables that equal 1 and 3 respectively, then use a loop to generate the rest of the numbers according to the adding rule above.

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!