Question Detail

COS 102 test topic Objective Question

Question

What is the primary difference between a pre-test loop and a post-test loop?
Options
A Pre-test loops evaluate termination conditions before body execution
Correct Answer
B Post-test loops execute only if the condition evaluates to false
C Pre-test loops execute at least once guaranteed
D Post-test loops cannot access global variables
Correct Answer

Option A is the correct answer.

Detailed Explanation

Pre-test loops evaluate the predicate upfront and may execute zero times if the condition is false initially.

Hint

No hint available

Question Info