CompTIA ITF+ (FC0-U61) — Question 190
Which of the following programming constructs would be used to repeat a statement 100 times in a loop?
Answer options
- A. IF
- B. ELSE
- C. RETURN
- D. WHILE
Correct answer: D
Explanation
The correct answer is D, WHILE, as it allows for the execution of a block of code as long as a specified condition is true, which can be set to repeat 100 times. A, IF, is used for conditional execution; B, ELSE, is used in conjunction with IF for alternative paths; and C, RETURN, is used to exit a function and return a value, not for looping.