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

On number 1 please.
Which of the equations have the correct notations? BA=4 /AB=4
10 pts!! Which function represents a reflection of f(x) = 3/7 (2)x over the x-axis? g(x) = – 3/7 (2)x g(x) = 3/7 (–2)x g(x) =3/7 (1/2) –x g(x) = 7/3 (2)
Who sets the salary of the president?        A. Congress   B. Vice President   C. Citizens   D. Senate
Cartilage ground substance includes chondroitin and hyaluronic acid. True or false
Plz give me the answer
Which works by the Olmecs prove they had an interest in astronomy? Glyphs engraved in stone that resemble present-day images of our solar system Remains of t
When someone invites you to tutear, which form would you then use to talk to that person? A. Tú B. Vosotros C. Ustedes D. Usted
Which of the following statements about the Federal Application for Student Aid (FAFSA) is TRUE? A)You can only apply online. B)The earliest you can submit your
Many members of the english gentry became willing to emigrate to the american colonies after