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 theorist believed in the collective consciousness
4. You are packing clothes for vacation and don't want to take any t-shirts. You randomly choose 3 shirts from a drawer containing 4 t-shirts, 3 polo shirts, an
items that are got from minerals​
what is the simple interest of $16000 interested for 5 years at 4% p.a?​
Please help me answer this
Why was slaves resisting be a good thing?
En una encuesta a 150 personas, se les pregunta sobre los deportes que ven por televisión los fines de semana, ofreciendo como opciones fútbol, tenis y basquetb
Aleena cuts 3/8 part of ribbon for her project.then again she cuts 4/5 part of the remaining ribbon the next day.find the total length of the Ribbon ,if 6.5 m o
What is the inverse matrix that can be used to solve this system of equations? x + 2y + 5z = 14 3x + 5y + 9z = −1 x + y = 2z = 6 - O A. P -19 9 -2 1 15 -7 6 OB.
If 4 more than twice a number is 8 less than three times the same number, what is the number?