C++ Interview Question 6 Answer

Bjarne-stroustrup
 

Answer

This question is compilable and deterministic.

Its output is “012012”.

Explanation

Whether you post-increment or pre-increment i, its value does not change until after the loop body has executed.

SOURCE