Question from the C++ - Fundamentals test

Write a C++ program that displays 111111.

Hard

Which statement(s) is (are) true ?

int main() {
    vector<int> v(3, 1);
    for (auto elem : v) {
        cout << elem;
        elem = 2;
    }
    for (auto elem : v) {
        cout << elem;
    }
    return 0;
}
Author: SamuelStatus: PublishedQuestion passed 14 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!