Ask Question
6 December, 23:11

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

+1
Answers (1)
  1. 6 December, 23:25
    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?
Find an answer to your question 👍 “It is legal to have a function with no arguments. TRUE FALSE ...” 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