Exam-style question
Try this first
Which statement about the use of subroutines is correct?.
- A.A subroutine can only be written at the point where it is first needed
- B.A subroutine is an unnamed block of code that cannot be called
- C.A subroutine can help reduce duplication by placing instructions in one named block
- D.A subroutine is the same as a hardware device
Answer and explanation
Concise answer
A subroutine can help reduce duplication by placing instructions in one named block
Why this is correct
Instructions that are needed in more than one place can be placed in a named subroutine and called when required, reducing duplicated code.
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.
