Ask Question
8 June, 01:32

It is legal to have a function with no arguments. TRUE FALSE

+4
Answers (1)
  1. 8 June, 03:58
    0
    TRUE

    Explanation:

    A parameter is a variable in a method definition and an argument is the value to this variable that gets passed to the function.

    public void CalculateAdd (int i, int j)

    {

    Console. WriteLine (i+j);

    }

    In the above defined function, i and j are parameters.

    We pass arguments when the function is called.

    CalculateAdd (10,20);

    10 and 20 are arguments which are passed to the above function to calculate addition operation.

    If a function has no parameters, then it is legal to have no arguments.

    For example,

    public void PrintMessage ()

    {

    Console. WriteLine ("Hello");

    }

    The above function has no parameters. So, you can call the function without passing any arguments to it as shown below.

    PrintMessage ();
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “It is legal to have a function with no arguments. TRUE FALSE ...” 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