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

Create an inequality to represent this problem . solve a graph the inequality on the number line below .Bahjo doesn't remember how much she spent at the store b
please help me ASAP!!!!
Solve for y and show steps 75-3.5y-4y=4y+6
write the expression 7 less than the product of 2 and k.
What is numeral value of 3/4 + 5/8
A rectangle is 6 times as long as it is wide. The perimeter is 60 cm. Find the dimensions of the rectangle. Round to the nearest tenth if necessary.
The proportional relationship between the gallons of gasoline used by Nathan, g, and the total number of miles he drives, m, can be represented by the equation
g(x) = 5x? – 9x - 7x + 12) What is the degree of the following polynomial?
A pie shop bakes a certain amount of pies each week. 150 of those pies are apple pies. These apple pies makes up 40 percent of the total pies. How many pies doe
can u help solve problem