Function Declaration/Prototyope

Cards (4)

  • Function Declaration/Prototype
    Syntax:
    returnType functionName(parameterList);
    where:
    returnType - data type of value to be returned by the function
    functionName - a unique identifier of the function
    parameterList - list of input variables with data type and separated by commas. It is sometimes called formal arguments.
  • Function Declaration/Prototype
    Syntax:
    returnType functionName(parameterList);
    where:
    returnType - data type of value to be returned by the function
    functionName - a unique identifier of the function
    parameterList - list of input variables with data type and separated by commas. It is sometimes called formal arguments.
  • Function Declaration/Prototype
    Example:
    void printDisplayFunction(string message);
    int addFunction (int n1, int n2);
    float computeFunction(float, float);
    double computeFunction(double = 1.0, double = 3.5);
    int swapFunction(int &x, int &y);
  • Function Declaration/Prototype Syntax: returnType functionName(parameterList); where: returnType - data type of value to be returned by the function functionName - a unique identifier of the function parameterList - list of input variables with data type and separated by commas. It is sometimes called formal arguments.