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

In the fourth paragraph, Churchill offers a “resolution” to the House of Commons in parliament to “record its approval of the steps taken and declare its confid
Use substitution to solve this system of the equations 2x-3y=-1 y=x-1
combina los elementos para formar oraciones completas
The function of a chromosome is to
I NEED HELP??? with this math problem?
This is a pre-test. You will be able to skip this lesson if your results show you have mastered this topic. There may be questions you cannot answer but try you
Can someone please help with question # 2
How did the Spanish-American War help create support for building the Panama Canal?
What is the square root of 9/16, 9 to the power of two
Determine if the functions are even, odd or neither. f(x) = -5x^4 - 2 and g(x) = x^3 + 2x A) odd, odd B) even, odd C) odd, even D) even, even