Exam-style question
Try this first
What is the main purpose of a parameter in a subroutine?.
- A.To pass data into the subroutine
- B.To permanently store every value used by the program
- C.To stop the subroutine from being called
- D.To display the subroutine's results automatically
Answer and explanation
Concise answer
To pass data into the subroutine
Why this is correct
Parameters allow a subroutine to receive data from the part of the program that calls it. This makes the subroutine usable with different data values.
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.
