Ask Question
17 November, 06:16

How do you return a value from a function?

+5
Answers (1)
  1. 17 November, 08:35
    0
    return instruction used to return a value from a function.

    Explanation:

    Function is a block of statement which perform the special task.

    Syntax for define a function:

    type name (parameter_1, parameter_2, ...)

    {

    statement;

    return variable;

    }

    In the syntax, type define the return type of the function. It can be int, float, double and also array as well. Function can return the array as well.

    return is the instruction which is used to return the value or can use as a termination of function.

    For return the value, we can use variable name which store the value or use direct value.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “How do you return a value from a function? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers