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

Greg picks apples to make money over the summer he earns $3 an hour plus $2.50 for each bushel he picks
5.why is it important for a country to have a plan of government?
8. How were people seated in the Coliseum?
What is the product of (2p + 7)(3p2 + 4p – 3)? A.6p3 + 29p2 – 34p + 21 B.6p3 + 29p2 – 22p + 21 C.6p3 + 29p2 + 22p – 21 D.6p3 + 29p2 + 34p – 21
hi guys, can anoye one tell me the rigth answer? I cant find the answer anywhere. please tell the correct answer.
hmm, i dont know how to do this
how to answer this question (wellness check, all clear?)​
What is the formula for manganese(III) oxide? Explain.
Find the sum of £1.98,87p and 23p write your answer in pounds £ write your answer in pence P
Find the slope of the line that passes through the following points: [tex]`\left(\frac{2}{5},\frac{2}{3}\right)\ \ \left(-\frac{4}{9},\frac{3}{5}\right)`[/tex]