nerdexam
CompTIA

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.

Software Development

Question

Which of the following contains reusable code?

Options

  • AConstant
  • BVariable
  • CFunction
  • DArray

How the community answered

(28 responses)
  • A
    4% (1)
  • C
    93% (26)
  • D
    4% (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.

AConstant

A constant is a fixed value that does not change during program execution and does not contain reusable code logic.

BVariable

A variable is a named storage location for data whose value can change, and it does not contain reusable executable code.

CFunctionCorrect

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.

DArray

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

#functions#reusable code#programming constructs

Community Discussion

No community discussion yet for this question.

Full FC0-U61 Practice