According to the given question, sales is a two-dimensional array and contains 10 rows and 7 columns wherein each component is of type integer and the variables sum and j are also of integer type.
<u>Explanation:</u>
In order to find the sum of the elements of the fifth row of sales, the correct piece of code should be:
sum=0;
for(j=0;j<7;j++)
sum=sum+sales[4][j];
The indexing in an array always starts from zero, therefore, to calculate the sum of the fifth row, the user has to write 4 in the index to point to the fifth row.
Answer:
False
Explanation:
There are also hackers online
The answer should be: True
Answer:
1. A function can use variables as parameters.
2. A function can have more than one parameter.
3. The definition of a function must come before where the function is used.
Explanation:
<u>The definition of a function can come before or after it is used</u> - I am pretty sure it cannot be placed after the function is being used. It should always come before it is used, so this statement is false.
<u>A function can use variables as parameters</u> - this is true, variables are just labels to hold data.
<u>A function can have more than one parameter</u> - this is true.
<u>A function must have a return value</u> - functions do not always have to <em>return</em> values. It could simply print, so this statement is false.
<u>The definition of a function must come before where the function is used</u> - As said earlier, the definition of functions must come before it is used/called. This statement is true.
Hope this helps :)