181k views
4 votes
printArray is a function that has two parameters. The first parameter is an array of element type int and the second is an int, the number of elements in the array. The function prints the contents of the array parameter; it does not return a value. inventory is an array of ints that has been already declared and filled with values. n is an int variable that holds the number of elements in the array. Write a statement that prints the contents of the array inventory by calling the function printArray.

1 Answer

3 votes

Answer:

printArray(inventory, n);

Step-by-step explanation:

The question doesn't specify in which language this has to be done, here's a generic call then... so if it's aimed at a specific language, some minor adjustments might be needed to respect the proper syntax/structure of that specific language.

Given:

printArray: function name, using 2 parameters.

inventory: array of ints

n : integer, number of items in array inventory

The call to the function would be:

printArray(inventory, n);

User Jorel Amthor
by
5.2k points