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

yesenia wants to bake cookies in her electric oven. the oven will transform electrical energy into ________ energy?
in china, to which social class did merchants, government officials, landlords, and confucian scholars belong?
The ratio of girls to boys in a school is 2:3 What fraction of these students are boys?
what is the correct order of structures in a chromosome from smallest to largest?
which are different forms of the same gene?
compare and contrast mental health and emotional health
a synonym for preparedness is
if juliet consistently buys health insurance for twenty years but never suffers a costly illness, were her premium payments wasted?
Expand these: a. (x + 2)(x - 2) b. (y - 4)(y + 2)
why is it important to not get distracted while driving?