thatcooldude1908 thatcooldude1908
  • 04-07-2019
  • Computers and Technology
contestada

2) What is the value stored in the variable z by the statements below?

int[ ] q = {3, 2, -2, 4, 7, 0, 1};
int z = q.length;

a) 1
b) 3
c) 6
d) 7
e) None of the above

Respuesta :

PhantomWisdom PhantomWisdom
  • 12-07-2019

Answer:

7

Explanation:

Because the q.length is a inbuilt function in the programming which used to get the length of the array. In the array, there are 7 values are store. Therefore, the size 7 store in the variable z.

For example:

int[] array={1,2};

int x = array.length;

the answer of above code is 2, because the elements present in the array is 2.

 

Answer Link

Otras preguntas

HELP PlEASE!!!!!! 1. Solve, using linear combination. 3x – y = 4 2x + y = 6 2. What is the y-coordinate of the solution to the system of equations? 5x - y
The angles of a quadrilateral measures 80,100. 100 and 80 in this order . what kind of quadrilateral has this shape? how do you know?
In 1713 how much of North America was an Independent country?
What is the quotient of 2/3 ➗ 5?
On a true/false test, the ratio of true questions to false questions is 3 to 7. What is the ratio of true questions to total questions?
How did European conquerors meet their need for labor on sugar plantations? A. They bought new machines that did much of the work. B. They brought enslaved Afri
Can the density of an object change?
What is the best approximation of the solution to the system to the nearest integer values. A.1,3 B. 3,2 C.2,3 D. 3,4
What was the most immediate obstacle to the formation of Israel
-2 5/22 as a decimal