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

how a convection current can enable a hawk or eagle to soar upward without flapping its wing
The vertical sequence of the layers of soil is called a soil
Experts agree that the minimum time period for cardiorespiratory benefit from exercise is _______ minutes.      A. 20B. 10C. 60D. 30
what is the value of the tape diagram if the ratio is 8 to 7 and the total is 195
Which rational number is greater? — 0.76 or 0.76? And why?
Write the word form and tell the value of the underlined digit. 9,000,009 the first 9 is underlined
AB←→ is perpendicular to CD←→. How many 90° angles are formed by the intersection?
How do you multiply mixed numbers and fractions?
is 2 squared between 1.4 and 1.5
food A contains 150 calories in 3/4 of a serving. food B contains 250 calories in 2/3 of a serving. which food has fewer calories per serving?