What will be displayed in the console? (-std=C++11)
#include <iostream>
#include <vector>
using namespace std;


int main()
{
    vector<int> v{1,1};
    for(int i=0; i!=5; ++i)
        v.push_back(*v.rbegin() + *(v.rbegin()+1));
    for(auto p: v)
        cout << p << ' ';
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes