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

simplify (1/x) + (1/(x+h)
in a parallelogram one angle is 9 times the size of another. find the measures of the angles
What is a synonym for sensory language?A.simileB.fluencyC.metaphorD.imagery im thinkin D?
find the point on the y-axis that is equidistant from (6,1) (-2,-3)
Describe a pattern in the sequence of numbers. Predict the next number. 1) 1, 2, 6, 24, ___ 2) 0, 3, 8, 15, 24, ___
Hassan's backyard swimming pool is 30 feet long, 20 feet wide, and 5 feet deep. There are 7.5 gallons of water in 1 cubic foot. How many gallons of water will t
How is 3x-y=8 and x+2y=5 solved by combination (addition)?????
How many flags are in this wolld ;)
simplify (1/x) + (1/(x+h)
Guess the mystery number.The number is greater then 10 and less then 18. The number is the sum of two identical odd numbers. What is the number? Show how you fo