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

Mitchell and Luke record the number of deliveries they each make for their family's restaurant. The results are shown in the box plots below. Select the true st
If you are examining a triangle with given measurements for one leg and the hypotenuse, how will you determine the measure of the unknown leg? Explain.
How does the state lottery works in regards to state tax revenue in Texas?
??????????????????????????????
A diet high in ________ is linked to increased risk of colon, stomach, and prostate cancers
Why did Lincoln decide not to send armed troops to Fort Sumter
limit approaches infinity of 3^n / 3n+1
What do the witches predict about Banquo?
How do the maps help strengthen John Muir’s main arguments?
Find evidence in the story of the grandmother's hypocrisy in believing she is "a lady," morally superior to others. Write a paragraph of about two hundred words