Ask Question

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

are passed?

+3
Answers (1)
  1. 7 October, 09:59
    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?
Find 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 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