Multiple choice technology programming languages

What is a loop ?

  1. A new type of Applet

  2. A segment of code to be run a specified amount of times

  3. A segment of code to be run infinite times

  4. A segment of code to be run once

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A loop is a programming construct that repeats a block of code multiple times based on a condition or counter. It allows efficient execution of repetitive tasks without writing the same code repeatedly. Option A is incorrect as loops are not applets. Option C describes infinite loops which are a special case not the general definition.