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

Insert the correct symbol 5 _ 4
Give the graph of this function f(x), find the following (use only integers) f(3) =
Alayna is paid £850 per month. Each month she spends 68% of her pay and saves the rest. How many months will it take Alayna to save £4624?​
Find ration of 350g to 7kg​
You are visiting a job site and observe a worker who is installing siding on a building. The worker is standing on the top step of a ladder that is not long eno
Subject verb agreement “either the car or the cyclist _____ responsible for the accident”
Choose the correct sentence.a. To get to Sacramento, travel North on Interstate 5. b. To get to Sacramento, travel north on interstate 5. c. To get to Sacrament
Find the word that has the same ending sound as "bread"?a. ready b. door c. lead
Which of the following is a true statement? 7/16>5/10, 5/16<8/24, 4/5<6/16,5/8<6/16
factorize 2x^4-x^3-6x^2+7x-2