In the loop construct for(exp1; exp2; exp3), which part is always executed exactly once?
Answer: A
Correct answer: exp1
exp1, the initialisation, is evaluated once before the loop starts and never again. exp2, the condition, is evaluated before every pass - at least once, and once more than the body runs. exp3, the update, runs after each pass, so it may not run at all if the condition fails immediately.
Please log in or register to report this question.