Which of the following statement best defines a formal parameter in programming?

2025

Which of the following statement best defines a formal parameter in programming?

  1. A.

    A constant defined outside the function

  2. B.

    A temporary value passed by reference only

  3. C.

    A value assigned to a global variable

  4. D.

    A variable listed in the function declaration to receive arguments

Attempted by 201 students.

Show answer & explanation

Correct answer: D

A formal parameter (often just called a "parameter") is the placeholder variable defined in the function's signature or declaration. It establishes the name and data type of the input the function expects to receive. When the function is actually called, these formal parameters are initialized with the real values (called actual parameters or arguments) passed by the caller.

Explore the full course: Rssb Senior Computer Instructor