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

Which is the correct form of the verb in the conditional- perfect tense? Vosotros _____ participado en un programa de intercambio. A. habriamos B. habriais C. h
#Algebra2 -someoneplshelp
What was mercury powder used for in 1800?
Pressure = Force Area The formula above shows how pressure relates to force and area. For example, the pressure exerted by a fluid is equal to the force of
A species is a group of organisms that _____.
What is the number of electrons shared between the atoms of I2
home address and date signature closing greeting body Sequence
True or false? Once the sun explodes, the whole solar system will go with it.
Which of the following is not a power of the United States Congress? A. Regulating commerce between the states B. Establishing and paying for the ar
Cholesterol belongs to the group of lipids called _____. a. fatty acids b. phospholipids c. steroids d. amino acids