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

y=2x+5 and y=3x-10. Solve equations
What issues present the most pressing problems for Canada? -high unemployment -lack of natural resources -low standard of living -outdated agricultural system -
why is frying an egg an example of a chemical change? A- atoms are lost during the reaction as bonds are broken. B- atoms are gained during the reaction as new
What is VJ-Day? What is VE-day
the bottom of a shopping bag measures 8 inches by 10 inches. th bag has a height of 12 inches. how much paper is needed to make the bag? A:256 in^2 B: 296 in^2
an ant sits on the back of a mouse. The mouse carries the ant across the floor for a distance of 10 meters. Was there work done by the mouse
what is the fact family for 3,6,18
what layers contain the densest materials
What dont traditional economies use a medium for trade?
Please help! Read the information below: In 1840, the population of Chicago was only 4,470. By 1900, the city's population was 1,698,575. Which factor contribut