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

The gas in a cylinder has a volume of 7 liters at a pressure of 107kPa. The pressure of the gas is increased to 208kPa. Assuming the temperature remains constan
Most queries have fully meets results
find an equation for the nth term of the arithmetic sequence. a19 = -58, a21 = -164
the scatter plot below shows the number of pages scanned (y) in different number of hours (x) by a scanning machine: plot ordered pairs 0, 500 and 1, 1500 and 2
a charged object cannot attract a neutral object. true false
In 1979, the united states faced a hostage crisis in a. egypt. b. israel. c. mexico. d. iran.
How does Douglass use the word nature in the excerpt from his narrative My Bondage and My Freedom?
Levittown became the first mass-produced suburban __________ in new york in 1948
can anybody help me out with this please
Where did US military officials expect the Japanese to attack during World War II?