Courseiva
easyMultiple ChoiceObjective-mapped

FC0-U71 Practice Question: A developer needs to repeat a set of instructions…

A developer needs to repeat a set of instructions exactly 10 times. Which programming construct should be used?

⚠ Common exam trap

CompTIA often tests the distinction between iteration (loops) and selection (conditionals), so the trap here is that candidates may confuse an if-else statement with a loop, thinking it can repeat instructions by nesting, but it cannot inherently iterate a fixed number of times.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

For loop

A for loop is the correct construct because it is specifically designed to execute a block of code a predetermined number of times, such as exactly 10 iterations. The loop's initialization, condition, and increment/decrement components allow precise control over the repetition count, making it ideal for this requirement.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • For loop

    Why this is correct

    A for loop is designed for iterating a specific number of times.

  • Variable

    Why it's wrong here

    A variable holds data, not a control structure for repetition.

  • Function

    Why it's wrong here

    A function groups code but does not automatically repeat it.

  • If-else statement

    Why it's wrong here

    If-else makes decisions, not repetitions.

About these practice questions

One of 988 original FC0-U71 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.