Question from the C++ - Fundamentals test

Print the numbers from 0 to 4 using a for loop in C++

Medium

What does display the following code ?

int main() {

    int i(120);

    for (int i(0); i < 5; i++) {
        std::cout << i << std::endl;
        i++;
    }

    std::cout << i << std::endl;
    return 0;
}
Author: SamuelStatus: PublishedQuestion passed 29 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!