FC0-U61 · Question #660
Which of the following contains reusable code?
The correct answer is C. Function. A function is the programming construct that contains reusable code, allowing a block of instructions to be defined once and invoked multiple times.
Question
Which of the following contains reusable code?
Options
- AConstant
- BVariable
- CFunction
- DArray
How the community answered
(28 responses)- A4% (1)
- C93% (26)
- D4% (1)
Why each option
A function is the programming construct that contains reusable code, allowing a block of instructions to be defined once and invoked multiple times.
A constant is a fixed value that does not change during program execution and does not contain reusable code logic.
A variable is a named storage location for data whose value can change, and it does not contain reusable executable code.
Functions encapsulate a specific task or set of operations, enabling developers to write code once and execute it whenever needed throughout a program without re-typing. This promotes modularity, reduces code redundancy, and improves program maintainability.
An array is a data structure for storing a collection of elements, but it does not contain reusable executable code.
Concept tested: Programming - Reusable code blocks
Topics
Community Discussion
No community discussion yet for this question.