Integer numElements is read from input. Then numElements integers are read and stored in vector numsList. Perform the following tasks:
Read the first element of numsList.
Read the second element of numsList.
Assign each subsequent element of numsList with the sum of the two previous elements.
#include
#include
using namespace std;
int main() {
int numElements;
unsigned int i;
vector numsList;
cin >> numElements;
numsList.resize(numElements);
write your code here
cout << "Sequence: ";
for (i = 0; i < numsList.size(); ++i) {
cout << numsList.at(i) << " ";
}
cout << endl;
return 0;
}