1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elena-2011 [213]
3 years ago
14

The Fibonacci sequence is a famous sequence in mathematics. The first two elements are defined as 1, 1. Subsequent elements are

defined as the sum of the preceding two elements. For example, the third element is 2 (=1+1), the fourth element is 3 (=1+2), the fifth element is 5 (=2+3), and so on.
Required;
Use a for loop to create a vector which contains the first 50 Fibonacci numbers.
Computers and Technology
1 answer:
Lena [83]3 years ago
8 0

Answer:

Written using C++

#include <iostream>  

#include <vector>  

using namespace std;  

int main() {  

vector<int> fibb;  

int n1 = 0;

int n2 = 1;

int temp;

for (int nm= 0; nm < 50;nm++) {

 fibb.push_back(n1);

 temp = n1 + n2;

 n1 = n2;

 n2 = temp;

}

for (int nm= 0; nm < 50;nm++) {

{

 cout<<fibb.at(nm)<<" ";

}

return 0;  

}

Explanation:

#include <iostream>  

#include <vector>  

using namespace std;  

int main() {  

This line declares the vector as integer

vector<int> fibb;  

This line initializes the first term to 0

int n1 = 0;

This line initializes the second term to 1

int n2 = 1;

This line declares a temporary variable

int temp;

The following iteration populates the vector with first 50 Fibonacci series

for (int nm= 0; nm < 50;nm++) {

This push an entry into the vector

 fibb.push_back(n1);

The following generate the next Fibonacci element

<em>  temp = n1 + n2;</em>

<em>  n1 = n2;</em>

 n2 = temp;

}

The following iteration prints the generated series

for (int nm= 0; nm < 50;nm++) {

 cout<<fibb.at(nm)<<" ";

<em> }</em>

return 0;  

}

You might be interested in
Will give brainliest!!!!!!!!!!!!
stira [4]
A trademark is a sign, symbol, name, or short phrase that indicates the source of a product or service.
3 0
4 years ago
Read 2 more answers
How does Accenture help companies harness the power of data to achieve optimal business outcomes?
EleoNora [17]

Accenture help companies harness the power of data to achieve optimal business outcomes as they develop data governance frameworks that go on to form the basis of the company's data analytics strategy.

<h3>What is Accenture known for?</h3>

Accenture is known to be a body that is known for its different range of service that they do offer as well as their  practice areas. These is made up of: strategy, management, digital, technology, and also that of operations consulting.

Accenture is known to be one that tends to helps a lot of firms to be able to make full use of the power of data to be able to get the proper market benefits from the data and they also allow the firms to learn and describe the "art of the possible" via the use of their data and analysis.

Therefore, Accenture help companies harness the power of data to achieve optimal business outcomes as they develop data governance frameworks that go on to form the basis of the company's data analytics strategy.

Learn more about Accenture  from

brainly.com/question/25682883

#SPJ1

See full question below

How does Accenture help companies harness the power of data to achieve optimal business outcomes?

- They help companies think about and define the "art of the possible" with their data assets.

- They develop data governance frameworks that go on to form the basis of the company's data analytics strategy.

- They utilize only their Data and Analytics Platform to enable companies.

- They provide an interactive front end for a database solution that changes the data culture.

5 0
2 years ago
For the past three years, the interviews conducted at Gavallet, an e-commerce site, have been following the same pattern. Candid
gtnhenbr [62]

Answer:

Structured interviews

Explanation:

An structured interview is an institutionalized method for interviewing work applicants dependent on the particular needs of the activity they are applying for. Up-and-comers are posed similar questions in a similar order, and are altogether looked at on a similar scale

For instance, you can direct them via telephone,  over the Internet, utilizing PC programs, for example, Skype, or utilizing videophone. Organized inquiries questions can be open-finished or shut finished.

3 0
3 years ago
If you paste a word document text into an excel spreadsheet, the paste optio allow you to keep source formatting or
castortr0y [4]
I think the answer is c
6 0
3 years ago
Often, the symptoms of withdrawal are __________.
guapka [62]
I would say none of the above as A, B, and C do not seem like sensible answers.
3 0
3 years ago
Other questions:
  • Jason is working on a project that requires him to manage a huge amount of data. The spreadsheet he is working on has data relat
    12·1 answer
  • A computer is defined by 4 specific criteri. Select all 4.*
    7·1 answer
  • Which of the following correctly describes the function of an IP address
    13·1 answer
  • MIDI is a A.technology based on placing brief digital recordings of live sounds under the control of a synthesizer keyboard. B.t
    10·1 answer
  • Complete the following conversions. You MUST show all of your work to receive full credit.
    13·1 answer
  • Heather has segmented all of the individuals in her database into four categories according to how many game tickets they purcha
    12·2 answers
  • What does f.i.r.s.t stand for in robotics
    15·1 answer
  • Solve a single producer, single consumer problem using wait() and notifyAll(). The producer must not overflow the shared buffer,
    5·1 answer
  • Every Java statement ends with: *<br><br> Period<br> Colon<br> Double quote<br> Semicolon
    11·2 answers
  • What is the purpose of a hyperlink in a presentation?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!