Ask Question
10 August, 21:43

When a function accepts multiple arguments, does it matter in what order the arguments

are passed?

+5
Answers (1)
  1. 10 August, 22:27
    0
    yes, it matter in what order the arguments are passed.

    Explanation:

    when we define the function in the programming, you have to call the function as well.

    In the calling function, we passed the arguments.

    In the define function, parameters in declare for taking a copy of the arguments.

    for example:

    int print (int value, double price, char a) {

    statement;

    }

    //calling

    print (5, 7.8, 'a');

    So, in the calling function the order of the argument changed, it gives the compile error.

    because 5 is the integer, so you have to store in the int parameter.

    print (7.8, 5, 'a') : if we try to do that, 7.8 which is double store in the wrong integer parameter, it gives the wrong output.

    similarly, if we define the array in the parameter and pass the integer in the argument on the same location. it gives the compile error.

    Therefore, the location must be the same.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “When a function accepts multiple arguments, does it matter in what order the arguments are passed? ...” 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