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

Your friend wants your advice about her new exercise plan. She has found a supplement that promises to increase her muscle size, but she wants to know what you
A cylinder shaped drum is used to store used motor oil. The drum has a height of 3 ft and a radius of 1.5 ft. How many cubic feet of oil does the drum hold? U
A nurse is assisting a patient with ambulation. the patient becomes short of breath and begins to complain of sharp chest pain. which action by the nurse is the
Need to know this asap please!!!
this doesnt seem right?
a quarterback threw a football 10 yards 2 feet and 1 inch. how many inches did the quarterback throw the football
What is the greatest injustice in the world?
Am I right on this question?
The equation shows the relationship between x and y: y = −4x + 9 What is the slope in the equation
what event brought the united states into world war 2 a. Germany's bombing of English cities b. japan attack on pearl harbor c. Italy invasion of Ethiopia d. G