In the function call result = add(10, 20);, what are 10 and 20 called?

2025

In the function call result = add(10, 20);, what are 10 and 20 called?

  1. A.

    Local variables

  2. B.

    Formal parameters

  3. C.

    Return types

  4. D.

    Actual parameters

Attempted by 103 students.

Show answer & explanation

Correct answer: D

In the function call result = add(10, 20);, the values 10 and 20 are known as actual parameters (or arguments). Actual parameters are the specific values or variables passed to a function at the time of its invocation. They provide the concrete data that the function will operate on during execution.

In contrast, formal parameters are the placeholder variables defined in the function's declaration that receive these values. For example, if the function is declared as add(int x, int y), then x and y are formal parameters. Local variables refer to variables declared within the function body, not passed from outside. Return types specify what kind of data a function sends back, such as int or void, and do not relate to the input values. Therefore, since 10 and 20 are the specific inputs provided during the call, they are correctly identified as actual parameters.

Explore the full course: Rssb Senior Computer Instructor