Ask Question
7 April, 19:35

How do you return a value from a function?

+5
Answers (1)
  1. 7 April, 19:54
    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?
Find an answer to your question 👍 “How do you return a value from a function? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers