Exam-style question
Try this first
What is the primary purpose of using 'selection' in an algorithm?.
- A.To repeat a set of instructions a fixed number of times.
- B.To process every element within an array.
- C.To make decisions and execute different code paths based on conditions.
- D.To ensure instructions are executed sequentially.
Answer and explanation
Concise answer
To make decisions and execute different code paths based on conditions.
Why this is correct
Selection, such as IF/THEN/ELSE statements, is specifically for decision-making and directing the flow of the algorithm based on whether a condition is true or false.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
